Class: Battlestation::Operations::ProcessCheck
- Defined in:
- lib/battlestation/operations/process_check.rb
Instance Attribute Summary collapse
-
#identifier ⇒ Object
Returns the value of attribute identifier.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(identifier, opts = {}) ⇒ ProcessCheck
constructor
A new instance of ProcessCheck.
- #status ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(identifier, opts = {}) ⇒ ProcessCheck
Returns a new instance of ProcessCheck.
6 7 8 9 10 11 |
# File 'lib/battlestation/operations/process_check.rb', line 6 def initialize(identifier, opts = {}) @identifier = identifier @type = :process @name = "process-#{identifier}" @opts = opts end |
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
4 5 6 |
# File 'lib/battlestation/operations/process_check.rb', line 4 def identifier @identifier end |
Instance Method Details
#status ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/battlestation/operations/process_check.rb', line 13 def status if process_running? { status: :okay, msg: "#{identifier} up and running", name: name } else { status: opts[:force_failure] ? :fail : :warn, msg: "#{identifier} not running", resolution: opts[:resolution], name: name } end end |