Home Directory Plugins Hardware UPS SNMP UPS Check

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

SNMP UPS Check

Rating
2 votes
Favoured:
1
Current Version
1.5
Last Release Date
2016-06-09
Compatible With
  • Nagios 3.x
  • Nagios 4.x
License
GPL
Hits
7281
Files:
FileDescription
check_ups_snmpVersion 1.5 Script
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Universal UPS check. Check for status of battery, temperature probes, voltage, load and much more!

Based on the plugin by Daniel DueƱas Domingo, this adds quite a number of bugfixes, adds SNMP v3 support and improved code logic and flow.
This plugin uses universal OIDs where possible to maximize compatibility with all UPS units. Some APC OID's are used but the bulk of the information is available to all models. This includes voltage, load, asset, self test status, alarms, temperatures and more!

This plugin has been tested thoroughly for working functionality, but only on APC UPS units we have at our facility.

Usage for SNMP v1/2c:
check_ups_snmp -H {host/IP} -t {type of check} [-C {SNMP community}]

Usage for SNMP v3:
check_ups_snmp -H {host/IP} -t {type of check} -u {user} -x {protocol} -X {password} -a {protocol} -A {password} -l {security mode}

Check types available are as follows:
alarm:
The number of active alarm conditions. If zero, status is OK, otherwise status is CRITICAL. When an alarm is present, the plugin will show the time and description for the alarm, but only if the UPS MIB files are available. You can specify the path to the MIBs with the -d option (by default, ./mibs is checked).

asset:
Returns the make, model, firmware and serial # of the unit. No perfdata is included in this check.

charge:
Estimated battery charge remaining, expressed as a % of full charge and time, in minutes. WARNING and CRITICAL values are required! These values should be provided as % charge.

input_lines:
The number of input lines utilized in this device.

load:
The percentage of the UPS capacity being used on the output line, i.e., the greater of the % capacity load and the % VA load. WARNING and CRITICAL values required! These values should be provided as % load.

output_lines:
The number of output lines utilized in this device.

selftest:
The results of the most recent UPS self-test. Returns CRITICAL if the test failed.

status:
The indication of the capacity remaining in the UPS system's batteries.
Normal indicates the remaining run-time is > upsConfigLowBattTime.
batteryLow indicates the remaining run-time is <= upsConfigLowBattTime.
batteryDepleted indicates the UPS will be unable to sustain the present load if utility power is lost or absent.
No perfdata is included in this check.

atemp|ambient:
The ambient temperature at the temperature probe, if installed. WARNING and CRITICAL values are required! These values should be provided as degrees C.

btemp|temp:
The ambient temperature at or near the UPS Battery casing. WARNING and CRITICAL values are required! These values should be provided as degrees C.

voltage:
The magnitude of the present input voltage in the input lines.
WARNING interval and CRITICAL values are required!
These values should be provided using an interval, marked by a :

Example: If the normal value is 400 V, a reasonable WARNING might be 395-405 V (a change of 5 V) and a good CRITICAL would be 390-410 V (a change of 10 V)
Reviews (1)
byargaar, May 7, 2018
Your script works ok, tested against a Riello UTM410K (with a netman 204 card).

The only bug I've found is on line 660, when you check for Warning/Critical threshold, my bash return an error due to the fact that you ask for a range (x:y) rather than a simple integer.

I would suggest to change the IF condition to

if [[ -z $WARNING ]] | [[ -z $CRITICAL ]]; then