Skip to content

UPS over SNMP (snmp_ups) ​

Reads an uninterruptible power supply that implements the standard UPS-MIB (RFC 1628), or the APC PowerNet MIB: battery status, charge, runtime, battery voltage and temperature, input and output voltage and frequency, load, and whether it is running on its battery. The sensor uses the UPS-MIB when the device has it and falls back to PowerNet when it does not, which is the case for many APC management cards. The state of the battery is the sensor's own verdict:

StateHealth
battery normal, on mainsUp
running on battery (upsOutputSource is battery; where the UPS has no such object, upsSecondsOnBattery above 0)Warning
battery lowWarning
battery depletedDown

On an APC card the output status adds to this: a UPS in bypass (software, switched or after a hardware failure) or asleep is a Warning, one whose output is off is Down, and one whose upsAdvBatteryReplaceIndicator asks for new batteries is a Warning. Smart boost and smart trim run from the mains and are not warnings.

Channels ​

KeyNameUnitDefault limits
battery_statusBattery statusnonevalue map: 1 unknown, 2 normal, 3 low, 4 depleted
on_batteryOn batterynonevalue map: 0 no, 1 yes (warning)
charge_pctBattery charge%warning below 50, error below 20
runtime_minRuntime remainingminwarning below 10, error below 5
battery_voltageBattery voltageVnone
battery_temp_cBattery temperature°Cwarning above 40, error above 50
input_voltageInput voltageVnone
input_hzInput frequencyHznone
output_voltageOutput voltageVnone
output_hzOutput frequencyHznone
load_pctLoad%warning above 80, error above 95

Objects the UPS does not implement are reported as unknown. Input and output voltage are those of the first line; load is the highest of the output lines, found by walking the load column, because some three-phase agents leave out the object that counts the lines. A battery temperature of exactly 0 is reported as unknown: several agents answer 0 when the UPS has no battery probe.

Over PowerNet the "high precision" objects (tenths of a percent, degree, volt and hertz) are used where the card has them, and the older whole-unit objects where it does not. The battery status object of PowerNet is missing on the cards recorded so far; without it the battery counts as normal, and the limits on charge and runtime are the early warning. The runtime is read in minutes from upsAdvBatteryRunTimeRemaining.

Parameters ​

ParameterDefaultMeaning
port161UDP port of the SNMP agent.

Suggested interval: 60 seconds. Credential: SNMP. Discovery adds this sensor to a device that answers upsBatteryStatus or the PowerNet upsBasicOutputStatus.

On the target ​

The UPS's network management card with SNMP switched on and a read-only community or v3 user. See SNMP setup for the principle; the card's own configuration screen is where it is done.

Failures ​

MessageMeaning
the device does not offer the UPS-MIB battery group ... or the APC PowerNet UPS objects (kind protocol)Not a UPS, an APC product that is not a UPS (an environment monitor, a power distribution unit), or a card that serves another vendor's MIB only (see below).
SNMP errorsAs for snmp_interface.

Verification ​

Against recordings of real devices replayed by an SNMP simulator (each recording answers under its own community), and against scripted agents built from RFC 1628 and from the PowerNet object definitions. The recordings are GPL-licensed, so none of them is in this repository; the tests name them and read the simulator from the environment, see Testing it yourself.

RecordingMIBReadNotes
Eaton 5PXUPS-MIBall eleven channelsBattery temperature answers 0: unknown.
Eaton 93PS (three phase)UPS-MIBall eleven channelsThe agent has no line count; load is the busiest phase (29), not the first (7).
Eaton 9PXUPS-MIBcharge, runtime, frequencies, loadBattery temperature 0: unknown.
Eaton 9PX with a second cardUPS-MIBcharge, runtime, voltagesNo input frequency and no load in the recording: unknown.
Dell tower 1000 WUPS-MIBall but the temperatureBattery temperature 0: unknown.
NetVision card (RFC 1628)UPS-MIBall but the runtimeThe card answers 65535 for the runtime: unknown.
Liebert APM (three phase)UPS-MIBruntime, voltages, output frequencyNo charge, battery or load objects in the recording.
CyberPower PR2200UPS-MIBall eleven channels
APC Smart-UPS X 750 (card with firmware 7)PowerNetall eleven channelsNo UPS-MIB and no battery status object.
APC Smart-UPS 1500, SUA1500RMPowerNetcharge, runtime, voltages, load
APC Smart-UPS RT 3000 XLPowerNetvoltages, frequenciesNo load in the recording.
APC Symmetra LXPowerNetruntime, battery voltage and temperature, load
APC card with PowerChutePowerNet, whole unitsall eleven channelsNo high precision objects.
APC NetBotz, APC rack PDUnonethe clear protocol failureNot UPSes.

Found by this and fixed: APC cards without the UPS-MIB were refused (and discovery did not offer the sensor for them); the load of a three-phase UPS whose agent has no line count was the first phase's; a battery temperature of 0 was shown as 0 degrees.

Not supported, because they serve only a vendor MIB: Eaton and Powerware cards with the xUPS MIB (1.3.6.1.4.1.534), MGE Galaxy and Pulsar cards (1.3.6.1.4.1.705), HPE UPS network modules (1.3.6.1.4.1.232) and Socomec cards (1.3.6.1.4.1.4555) when they do not also serve the UPS-MIB. The sensor fails on these with the message above.

Not seen: a UPS on battery, in bypass or with a battery that wants replacing, a battery low or depleted (every recording is of a healthy UPS on mains; those states are tested on scripted agents only), SNMPv3, and agents with several input lines whose first line is not number 1.

Discovery against recordings ​

What discovery proposed for each recording, with the shipped templates (the ping sensor is left out: it depends on the address answering).

RecordingMain templateAdd-onsSensors
APC Smart-UPS X 750, SMX, Symmetra, SUA, PowerChuteSNMP deviceUPS (SNMP)uptime where answered, UPS
APC UPS card with a connected temperature probe (SMX 750i, SUA 1500)SNMP deviceUPS (SNMP), Temperature and humidity probes (SNMP)uptime, UPS, environment
APC NetBotz and environment monitorsSNMP deviceTemperature and humidity probes (SNMP)uptime where answered, environment
APC rack PDUSNMP devicenoneuptime where answered
Eaton 5PX, 9PX, 93PS, Dell tower, CyberPowerSNMP deviceUPS (SNMP)uptime, UPS
NetVision card on a Linux boardLinux host (net-snmp)UPS (SNMP)uptime, CPU, memory, UPS
Linux host (net-snmp), QNAP TS-431, UniFiLinux host (net-snmp)nonewhat the recording answers (CPU on the net-snmp host)
Synology DiskStations, QNAP with the NAS MIBLinux host (net-snmp)Synology or QNAP hardware health, SNMP storageuptime, CPU, memory, interfaces, disks, hardware health
HPE ProLiant iLOSNMP deviceHPE server hardware health (and SNMP storage where it lists disks)uptime, interfaces, hardware health
Arista EOS switchSNMP devicenoneuptime, CPU, memory, interfaces
Aruba CX 8360, Dell OS10 switchSNMP deviceSNMP storageuptime, CPU, memory
pfSenseSNMP devicenoneuptime, CPU, memory, interfaces
MikroTik RouterOSSNMP deviceSNMP storageuptime, CPU, memory, interfaces, disk
VMware ESXiSNMP deviceSNMP storageuptime, CPU, memory, interfaces, disks
TrueNASSNMP deviceSNMP storageuptime, CPU, memory, interfaces, disks
Brother and Dell laser printersSNMP devicePrinter (SNMP)uptime, memory, interface, printer
FortiGate 100ESNMP devicenoneuptime, interfaces
NetApp filerSNMP deviceNetApp hardware healththe hardware health sensor, which can only fail here: the recording answers sysDescr and nothing else
Dell modular chassis (not a server), NetApp E-series, Juniper EX, Cisco small business, HP and Netgear switches, Windows, OPNsense, VyOSSNMP devicenoneonly what the recording answers: often the system group only

Two things stood out. The recordings are sparse (only what the recorder polled), so a switch that answers nothing below the system group gets a ping and nothing more, which is right for what it answers. And a host with a UPS card on a Linux board is matched by the more specific host template, with the UPS add-on on top, which is the intent of the add-on role.

Testing it yourself ​

crates/probeward-sensors/tests/snmpsim_live.rs runs the sensor and discovery against an SNMP simulator that serves recordings, each under a community named after its file. It reads PROBEWARD_TEST_SNMPSIM_HOST (the address), PROBEWARD_TEST_SNMPSIM_PORT (161 when unset) and PROBEWARD_TEST_SNMPSIM_COMMUNITIES (the recording names the simulator serves, separated by commas or spaces), and skips when they are unset or a recording is not listed. Every request is a read. The recordings of the LibreNMS project that were used are GPL-licensed and are not copied here; a small hand-written fixture in the unit tests states one OID and its value where a test needs one.

AGPL-3.0-only