Class: Monitors::Processes

Inherits:
Base
  • Object
show all
Defined in:
lib/monitors/processes.rb

Class Method Summary collapse

Methods inherited from Base

run

Methods included from Logging

#log, #logger

Class Method Details

.check_intervalObject



25
26
27
# File 'lib/monitors/processes.rb', line 25

def check_interval
  Cfg.processes_check_interval
end

.perform_checkObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/monitors/processes.rb', line 8

def perform_check
  missing_processes = Phantom::Collector.missing_ports.map do |port|
    p = Phantom::Process.new
    p.port = port
    p
  end

  missing_processes.each do |p|
    if ViolationsRecorders::Processes.is_violating?(p)
      log "found missing phantom on port #{p.port}"
      Phantom::Manager.start(p)
    end
  end

  log "All processes are running OK" if missing_processes.empty?
end