Class: Flapjack::Gateways::Oobetet::Notifier

Inherits:
Object
  • Object
show all
Defined in:
lib/flapjack/gateways/oobetet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Notifier

Returns a new instance of Notifier.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/flapjack/gateways/oobetet.rb', line 24

def initialize(options = {})
  @lock = options[:lock]
  @config = options[:config]

  @hostname = Socket.gethostname

  unless @config['watched_check']
    raise RuntimeError, 'Flapjack::Oobetet: watched_check must be defined in the config'
  end
  @check_matcher = '"' + @config['watched_check'] + '"'

  @flapjack_ok = true
  @last_alert = nil
  @last_breach = nil
end

Instance Attribute Details

#siblingsObject

Returns the value of attribute siblings.



22
23
24
# File 'lib/flapjack/gateways/oobetet.rb', line 22

def siblings
  @siblings
end

Instance Method Details

#startObject



40
41
42
43
44
45
46
47
48
# File 'lib/flapjack/gateways/oobetet.rb', line 40

def start
  loop do
    @lock.synchronize do
      check_timers
    end

    Kernel.sleep 10
  end
end

#stop_typeObject



50
51
52
# File 'lib/flapjack/gateways/oobetet.rb', line 50

def stop_type
  :exception
end