Class: Monittr::Services::Host
Overview
A “host” service in Monit
mmonit.com/monit/documentation/monit.html#connection_testing
<service type=“4”>
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(xml) ⇒ Host
constructor
A new instance of Host.
Methods inherited from Base
Constructor Details
#initialize(xml) ⇒ Host
Returns a new instance of Host.
161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/monittr.rb', line 161 def initialize(xml) @xml = xml super( { :name => value('name' ), :status => value('status', :to_i), :monitored => value('monitor', :to_i), :response_time => value('port/responsetime' ) } ) rescue Exception => e puts "ERROR: #{e.class} -- #{e.}, In: #{e.backtrace.first}" super( { :name => 'Error', :status => 3, :message => e. } ) end |