Class: Monittr::Services::Process
- Defined in:
- lib/monittr.rb
Overview
A “process” service in Monit
mmonit.com/monit/documentation/monit.html#pid_testing
<service type=“3”>
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(xml) ⇒ Process
constructor
A new instance of Process.
Methods inherited from Base
Constructor Details
#initialize(xml) ⇒ Process
Returns a new instance of Process.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/monittr.rb', line 136 def initialize(xml) @xml = xml super( { :name => value('name' ), :status => value('status', :to_i), :monitored => value('monitor', :to_i), :pid => value('pid', :to_i), :uptime => value('uptime', :to_i), :memory => value('memory/percent', :to_f), :cpu => value('cpu/percent', :to_i) } ) rescue Exception => e puts "ERROR: #{e.class} -- #{e.}, In: #{e.backtrace.first}" super( { :name => 'Error', :status => 3, :message => e. } ) end |