Module: HawatelTlb::WatchDog
- Included in:
- Client
- Defined in:
- lib/hawatel_tlb/watchdog.rb
Instance Method Summary collapse
-
#watcher ⇒ Object
Check node status.
Instance Method Details
#watcher ⇒ Object
Check node status
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/hawatel_tlb/watchdog.rb', line 10 def watcher @group.each do |node| if node.state == 'enable' start = Time.now() port_open?(node) ? port_state = 'online' : port_state = 'offline' stop = Time.now() - start node.status = {:time => Time.now.to_i, :state => port_state, :respond_time => stop.round(4)} end end end |