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:
| State | Health |
|---|---|
| battery normal, on mains | Up |
running on battery (upsOutputSource is battery; where the UPS has no such object, upsSecondsOnBattery above 0) | Warning |
| battery low | Warning |
| battery depleted | Down |
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
| Key | Name | Unit | Default limits |
|---|---|---|---|
battery_status | Battery status | none | value map: 1 unknown, 2 normal, 3 low, 4 depleted |
on_battery | On battery | none | value map: 0 no, 1 yes (warning) |
charge_pct | Battery charge | % | warning below 50, error below 20 |
runtime_min | Runtime remaining | min | warning below 10, error below 5 |
battery_voltage | Battery voltage | V | none |
battery_temp_c | Battery temperature | °C | warning above 40, error above 50 |
input_voltage | Input voltage | V | none |
input_hz | Input frequency | Hz | none |
output_voltage | Output voltage | V | none |
output_hz | Output frequency | Hz | none |
load_pct | Load | % | 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
| Parameter | Default | Meaning |
|---|---|---|
port | 161 | UDP 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
| Message | Meaning |
|---|---|
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 errors | As 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.
| Recording | MIB | Read | Notes |
|---|---|---|---|
| Eaton 5PX | UPS-MIB | all eleven channels | Battery temperature answers 0: unknown. |
| Eaton 93PS (three phase) | UPS-MIB | all eleven channels | The agent has no line count; load is the busiest phase (29), not the first (7). |
| Eaton 9PX | UPS-MIB | charge, runtime, frequencies, load | Battery temperature 0: unknown. |
| Eaton 9PX with a second card | UPS-MIB | charge, runtime, voltages | No input frequency and no load in the recording: unknown. |
| Dell tower 1000 W | UPS-MIB | all but the temperature | Battery temperature 0: unknown. |
| NetVision card (RFC 1628) | UPS-MIB | all but the runtime | The card answers 65535 for the runtime: unknown. |
| Liebert APM (three phase) | UPS-MIB | runtime, voltages, output frequency | No charge, battery or load objects in the recording. |
| CyberPower PR2200 | UPS-MIB | all eleven channels | |
| APC Smart-UPS X 750 (card with firmware 7) | PowerNet | all eleven channels | No UPS-MIB and no battery status object. |
| APC Smart-UPS 1500, SUA1500RM | PowerNet | charge, runtime, voltages, load | |
| APC Smart-UPS RT 3000 XL | PowerNet | voltages, frequencies | No load in the recording. |
| APC Symmetra LX | PowerNet | runtime, battery voltage and temperature, load | |
| APC card with PowerChute | PowerNet, whole units | all eleven channels | No high precision objects. |
| APC NetBotz, APC rack PDU | none | the clear protocol failure | Not 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).
| Recording | Main template | Add-ons | Sensors |
|---|---|---|---|
| APC Smart-UPS X 750, SMX, Symmetra, SUA, PowerChute | SNMP device | UPS (SNMP) | uptime where answered, UPS |
| APC UPS card with a connected temperature probe (SMX 750i, SUA 1500) | SNMP device | UPS (SNMP), Temperature and humidity probes (SNMP) | uptime, UPS, environment |
| APC NetBotz and environment monitors | SNMP device | Temperature and humidity probes (SNMP) | uptime where answered, environment |
| APC rack PDU | SNMP device | none | uptime where answered |
| Eaton 5PX, 9PX, 93PS, Dell tower, CyberPower | SNMP device | UPS (SNMP) | uptime, UPS |
| NetVision card on a Linux board | Linux host (net-snmp) | UPS (SNMP) | uptime, CPU, memory, UPS |
| Linux host (net-snmp), QNAP TS-431, UniFi | Linux host (net-snmp) | none | what the recording answers (CPU on the net-snmp host) |
| Synology DiskStations, QNAP with the NAS MIB | Linux host (net-snmp) | Synology or QNAP hardware health, SNMP storage | uptime, CPU, memory, interfaces, disks, hardware health |
| HPE ProLiant iLO | SNMP device | HPE server hardware health (and SNMP storage where it lists disks) | uptime, interfaces, hardware health |
| Arista EOS switch | SNMP device | none | uptime, CPU, memory, interfaces |
| Aruba CX 8360, Dell OS10 switch | SNMP device | SNMP storage | uptime, CPU, memory |
| pfSense | SNMP device | none | uptime, CPU, memory, interfaces |
| MikroTik RouterOS | SNMP device | SNMP storage | uptime, CPU, memory, interfaces, disk |
| VMware ESXi | SNMP device | SNMP storage | uptime, CPU, memory, interfaces, disks |
| TrueNAS | SNMP device | SNMP storage | uptime, CPU, memory, interfaces, disks |
| Brother and Dell laser printers | SNMP device | Printer (SNMP) | uptime, memory, interface, printer |
| FortiGate 100E | SNMP device | none | uptime, interfaces |
| NetApp filer | SNMP device | NetApp hardware health | the 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, VyOS | SNMP device | none | only 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.