Class: Arborist::Monitor::SNMP::UPS::Battery

Inherits:
Object
  • Object
show all
Extended by:
Configurability, Loggability
Includes:
Arborist::Monitor::SNMP
Defined in:
lib/arborist/monitor/snmp/ups/battery.rb

Overview

Checks for UPS battery health.

Checks the available battery percentage, if the UPS is on battery, and the temperature of the battery.

Constant Summary collapse

OIDS =

OIDS for discovering ups status.

{
  battery_status:        '.1.3.6.1.2.1.33.1.2.1.0', # 1 - unk, 2 - normal, 3 - low, 4 - depleted
  seconds_on_battery:    '.1.3.6.1.2.1.33.1.2.2.0',
  est_minutes_remaining: '.1.3.6.1.2.1.33.1.2.3.0',
  est_charge_remaining:  '.1.3.6.1.2.1.33.1.2.4.0', # in percent
  battery_voltage:       '.1.3.6.1.2.1.33.1.2.5.0', # in 0.1v DC
  battery_current:       '.1.3.6.1.2.1.33.1.2.6.0', # in 0.1a DC
  battery_temperature:   '.1.3.6.1.2.1.33.1.2.7.0'  # in Celcius
}
BATTERY_STATUS =

Human-readable translations for battery status OID.

{
  1 => "Battery status is Unknown.",
  2 => "Battery is OK.",
  3 => "Battery is Low.",
  4 => "Battery is Depleted."
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.node_propertiesObject

Return the properties used by this monitor.



51
52
53
# File 'lib/arborist/monitor/snmp/ups/battery.rb', line 51

def self::node_properties
  return USED_PROPERTIES
end

.run(nodes) ⇒ Object

Class #run creates a new instance and immediately runs it.



58
59
60
# File 'lib/arborist/monitor/snmp/ups/battery.rb', line 58

def self::run( nodes )
  return new.run( nodes )
end

Instance Method Details

#run(nodes) ⇒ Object

Perform the monitoring checks.



65
66
67
68
69
# File 'lib/arborist/monitor/snmp/ups/battery.rb', line 65

def run( nodes )
  super do |host, snmp|
    self.check_battery( host, snmp )
  end
end