Class: Checkson::Check::Process

Inherits:
Shell show all
Defined in:
lib/checkson/checks/process.rb

Instance Attribute Summary

Attributes inherited from Base

#messages, #status

Instance Method Summary collapse

Methods inherited from Base

#failed?, #ok?

Constructor Details

#initialize(opts = {}) ⇒ Process

Returns a new instance of Process.

Raises:

  • (ArgumentError)


8
9
10
11
12
13
# File 'lib/checkson/checks/process.rb', line 8

def initialize(opts = {})
  @opts = opts
  raise ArgumentError, 'Neither pidfile nor process name given' unless @opts[:pidfile] || @opts[:name]

  super()
end

Instance Method Details

#checkObject



15
16
17
# File 'lib/checkson/checks/process.rb', line 15

def check
  @opts[:pidfile] ? check_pidfile : check_name
end