Skip to content

Commit

Permalink
Add play section.
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Feb 9, 2015
1 parent 74c3795 commit 73c321b
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,54 @@ OpenFlow switch liveness monitor.
[codeclimate]: https://codeclimate.com/github/trema/switch_monitor
[gemnasium]: https://gemnasium.com/trema/switch_monitor
[inch]: http://inch-ci.org/github/trema/switch_monitor

Install
-------

```
$ git clone https://github.com/trema/switch_monitor.git
$ cd switch_monitor
$ bundle install
```


Play
----

Run this controller:

```
% bundle exec trema run ./lib/switch_monitor.rb -c trema.conf
All switches =
Switch 0x3 is UP
Switch 0x2 is UP
Switch 0x1 is UP
All switches = 0x1, 0x2, 0x3
...
```

On another terminal, stop and restart running switches with `trema
kill` and `trema up` command, and switch_monitor.rb outputs the
current switch status.

```
(On another terminal)
% bundle exec trema kill 0x1
% bundle exec trema up 0x1
```

```
% bundle exec trema run ./lib/switch_monitor.rb -c trema.conf
All switches =
Switch 0x3 is UP
Switch 0x2 is UP
Switch 0x1 is UP
All switches = 0x1, 0x2, 0x3
...
Switch 0x1 is DOWN
All switches = 0x2, 0x3
...
Switch 0x1 is UP
```

Enjoy!

0 comments on commit 73c321b

Please sign in to comment.