Class: XymonClient::ServiceItemString
- Inherits:
-
ServiceItem
- Object
- ServiceItem
- XymonClient::ServiceItemString
- Defined in:
- lib/xymonclient/serviceitem.rb
Instance Attribute Summary
Attributes inherited from ServiceItem
#attributes, #description, #enabled, #label, #lifetime, #time, #value
Instance Method Summary collapse
Methods inherited from ServiceItem
#context, #initialize, #update_config
Constructor Details
This class inherits a constructor from XymonClient::ServiceItem
Instance Method Details
#status ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/xymonclient/serviceitem.rb', line 126 def status @status = \ if !@enabled 'clear' elsif Time.now - @time > \ XymonClient.timestring_to_time(@lifetime) 'purple' elsif @threshold.key?('critical') && \ _threshold_reached?('critical') 'red' elsif @threshold.key?('warning') && \ _threshold_reached?('warning') 'yellow' else 'green' end end |