Monitor UPS batteries with NUT and Grafana
UPS battery alarms often arrive at the worst possible moment: during a storm, a planned shutdown, or a busy trading week. A glowing “online” indicator only says the inverter is working; it can say nothing about the battery’s remaining capacity or whether it will carry a load through the next interruption.
A useful monitoring stack joins Network UPS Tools (NUT) with Prometheus and Grafana. NUT reads the UPS, an exporter converts selected values into metrics, and Grafana turns runtime, load and electrical state into dashboards and alerts. The result is earlier warning and a clearer basis for deciding when a battery needs replacement.
What NUT can reveal about battery condition
Start with the model number and NUT driver in mind because supported fields vary between manufacturers. After connecting the USB, serial or network interface, upsc can expose values such as battery.runtime, battery.voltage, battery.charge, ups.load and ups.status. Treat the field names as driver-specific rather than a universal schema.
Battery health is not the same as battery charge. A battery sitting on mains may report 100% charge while retaining little usable capacity. Runtime under a known load is usually the stronger indicator because it falls as capacity fades. Voltage and charge percentage remain useful context, but neither proves the cells are healthy.
A practical baseline captures runtime, load, ambient temperature and operating state at commissioning and after every battery replacement. Compare later readings with that baseline rather than using a generic cutoff such as “less than ten minutes”. A UPS supporting 800 W and a small network switch may legitimately provide very different runtimes under the same mains failure.
Build a dependable collection path
Run NUT on a small always-on host close to the UPS interface. USB or serial avoids network polling and makes a failed switch or VLAN less likely to hide a low battery. For a network-managed unit, use the appropriate SNMP or vendor driver and restrict the UPS management network.
Keep upsd and upsmon available for shutdown control, but give Grafana read-only data through an exporter. NUT does not natively expose a Prometheus endpoint, so map only the fields you trust to stable metric names. Include the UPS identifier, timestamp and collection errors so dashboards can distinguish a healthy zero from missing data.
That architecture matches the practical, small-team infrastructure approach used in Karl Katzke’s Blog, where observability is tied to an operational decision. Secure the exporter with firewall rules and, where possible, TLS or authentication; do not expose NUT management interfaces to the public internet.
Design Grafana panels around decisions
Grafana should answer four questions: Is the UPS online, how long can it run, how heavily is it loaded, and is the battery deteriorating? Put status, runtime, load and input voltage at the top. Add a compact timeline of on-battery events, since their duration often explains the latest runtime change better than a single gauge.
Use a Prometheus datasource and label every metric with the UPS name, site and room. Variables should let an operator switch between devices without rewriting queries. Standardise units in the exporter—seconds for runtime, percent for load and volts for voltage—so dashboard thresholds remain predictable.
A second panel can compare current runtime with the recorded baseline while displaying the load percentage. This comparison is more meaningful than a synthetic “battery health” percentage. Show the baseline’s age, and annotate every battery replacement so an apparent recovery is not mistaken for silent regeneration.
Detect degradation with useful alerts
A controlled runtime test creates the reference, but follow the manufacturer’s guidance and never repeatedly deep-discharge a battery that should remain on float charge. Test under a repeatable load, record the start and stop times, and repeat after maintenance or a battery change. Keep the load within a narrow band; otherwise runtime noise can trigger false alarms.
Illustrative recording rules might compare runtime with the baseline only when load is within ten percent of the test value. Alert when the ratio falls below about 0.8 for several consecutive samples, not on a single reading. Separate rules should cover prolonged on-battery operation, overload, abnormal input voltage and stale telemetry.
Treat missing data as a monitoring failure, not as proof that the battery is fine. A no-data alert after a few minutes is often more valuable than another low-runtime threshold. Route urgent alerts to a channel that works during an outage, and send routine dashboard summaries to email or a team chat service.
Account for Australian operating conditions
Australian mains is 230 V, 50 Hz, so verify the UPS input range, plug configuration and server power supplies before installation. A mains loss is commonly called a power outage; when voltage dips without disappearing, it is often called a brownout. Australian suppliers often advertise runtime in minutes and capacity in VA, while server planners work in watts, so compare both at the real load.
Heat is the quiet enemy of stationary batteries. Warm weather in Melbourne, Brisbane and Adelaide shortens service life, so keep the cabinet ventilated and record rack temperature beside runtime. Storms, bushfire activity and damaged infrastructure can prolong outages across regional New South Wales, Western Australia and Queensland; long event logs reveal whether runtime is falling because of capacity or repeated heavy discharge.
Remote monitoring needs an independent communications path because an NBN or fixed-line service can fail during the same event. A dual-carrier 4G or 5G backup link is often more useful than another dashboard when the rack is already dark. The same preparation matters for field operations: search-and-rescue volunteers can use staged shutdowns and checked spare power instead of trusting a single “online” light.
Recommendations for a reliable rollout
The following checklist keeps the stack useful after the first successful dashboard is live.
- Document the UPS model, NUT driver, exposed fields and firmware version so upgrades can be compared against known baselines.
- Restrict NUT and exporter access to the monitoring host, protect credentials and test recovery of the collection service.
- Capture a runtime baseline at a documented load, then repeat it on a schedule set by the manufacturer and operating risk.
- Show online status, remaining runtime, load, input voltage and recent on-battery events on the first dashboard screen.
- Alert on low runtime, prolonged on-battery operation, overload, abnormal voltage and missing telemetry, with suitable persistence periods.
- Retain event history, note battery replacements and review thresholds after genuine load changes rather than tuning them for convenience.
Run each alert as a rehearsal and confirm that someone owns the response. A dashboard nobody checks is decoration, while a noisy alert stream trains the team to ignore warnings.
Start with one UPS carrying genuinely important equipment, then prove the full path from sensor to alert. Keep the hardware simple, document the assumptions behind each threshold, and review the dashboard during a planned maintenance window rather than during an emergency.
Install the NUT collector and exporter this week, publish the first dashboard, and deliberately trigger a missing-telemetry alert before relying on the system to protect production equipment.
Karl Katzke