Class: Heartcheck::Checks::Process

Inherits:
Base
  • Object
show all
Defined in:
lib/heartcheck/checks/process.rb

Instance Attribute Summary

Attributes inherited from Base

#dev, #functional, #name, #timeout

Instance Method Summary collapse

Methods inherited from Base

#add_service, #check, #informations, #initialize, #on_error, #register_dynamic_services, #services, #to_validate

Constructor Details

This class inherits a constructor from Heartcheck::Checks::Base

Instance Method Details

#validateObject


4
5
6
7
8
9
10
11
12
13
# File 'lib/heartcheck/checks/process.rb', line 4

def validate
  services.each do |service|
    begin
      pid = get_pid(service)
      ::Process.kill(0, pid)
    rescue Errno::ESRCH
      append_error(service, pid)
    end
  end
end