Class: Deadpool::Monitor::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/deadpool/monitor/base.rb

Direct Known Subclasses

GenericNagios, Mysql, Redis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, monitor_config, logger) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/deadpool/monitor/base.rb', line 6

def initialize(config, monitor_config, logger)
  @config, @monitor_config, @logger = config, monitor_config, logger
end

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



4
5
6
# File 'lib/deadpool/monitor/base.rb', line 4

def logger
  @logger
end

Instance Method Details

#primary_ok?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/deadpool/monitor/base.rb', line 10

def primary_ok?
  raise NotImplementedError, "primary_ok? is not implemented"
end

#secondary_ok?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/deadpool/monitor/base.rb', line 14

def secondary_ok?
  raise NotImplementedError, "secondary_ok? is not implemented"
end

#stateObject



23
24
25
# File 'lib/deadpool/monitor/base.rb', line 23

def state
  @state ||= Deadpool::State.new name, self.class
end

#system_checkObject



18
19
20
21
# File 'lib/deadpool/monitor/base.rb', line 18

def system_check
  update_state
  take_snapshot
end