Sha256: 303ed1509dc737412ce2454d3c8dd97d7ed1d3e26a114fc671fca8904a4cb1cf
Contents?: true
Size: 575 Bytes
Versions: 1
Compression:
Stored size: 575 Bytes
Contents
class Nagira < Sinatra::Base class HostService def initialize(hostname,servicename) @hostname = hostname @servicename = servicename end attr_reader :hostname, :servicename def status begin $nagios[:status] .status['hosts'][hostname]['servicestatus'][servicename] rescue NoMethodError { } end end alias :full :status def state status.slice('host_name', 'service_description', 'current_state') end def current_state status.slice('current_state') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nagira-0.5.0 | lib/nagira/hostservice.rb |