Class: Zabbirc::Services::Ops

Inherits:
Base
  • Object
show all
Defined in:
lib/zabbirc/services/ops.rb

Constant Summary

Constants inherited from Base

Base::LOOP_SLEEP

Instance Attribute Summary

Attributes inherited from Base

#running

Instance Method Summary collapse

Methods inherited from Base

#initialize, #join, #start, #stop, #synchronize

Constructor Details

This class inherits a constructor from Zabbirc::Services::Base

Instance Method Details

#iterateObject



4
5
6
7
8
9
# File 'lib/zabbirc/services/ops.rb', line 4

def iterate
  sync_ops
  synchronize do
    @service.ops.dump_settings
  end
end

#sync_opsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/zabbirc/services/ops.rb', line 11

def sync_ops
  synchronize do
    sync_zabbix
    @cinch_bot.channels.each do |channel|
      sync_irc channel
    end
  end
rescue Zabbix::NotConnected => e
  if Zabbix::Connection.up?
    @service.ops.interested.notify e.to_s
    Zabbix::Connection.down!
  end
end