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.

Experience

Information Technology Consulting

Independent Practice

Provides IT consulting services focused on infrastructure planning, cloud migration strategy, and systems architecture. Engagements draw on years of hands-on sysadmin and development experience across Linux, Windows, and hybrid environments.

K9 Search & Rescue Volunteer

Ongoing

Active participant in K9 Search & Rescue operations, combining technical logistics skills with field support for canine search teams.

Karl Katzke's Blog

October 2006 – May 2014

Published a long-running personal technology blog covering cloud vs. in-house infrastructure, F# and Mono on OSX, hardware vendor critiques, RAID card performance analysis, and sysadmin storytelling. Notable posts include "When Sysadmins Ruled the Earth" (May 15, 2014) and "Getting Started with F# and Mono on OSX" (December 22, 2012).

Credentials

A small badge icon with a shield shape in muted blue tones on a light background

Systems Administration

Deep experience with Linux (RHEL, SLES, CentOS), high-availability clusters, and STONITH configurations.

A small badge icon with a gear shape in muted blue tones on a light background

Cloud Infrastructure

Practical knowledge of AWS EC2, reserved instances, and cost analysis for cloud vs. on-premises deployments.

A small badge icon with a code symbol in muted blue tones on a light background

Development

Proficient in F#, PHP (Symfony), and cross-platform tooling including Mono and MonoDevelop on OSX.

Studies

F# & Functional Programming

Self-directed, 2012

Explored strongly typed functional programming with F# on OSX using the Mono runtime. Published a detailed getting-started guide covering toolchain setup and cross-platform game development research.

High-Availability & Cluster Management

Professional Development, 2009

Configured and documented crm_mon email alerting for STONITH events on SLES11-HAE clusters, integrating with Nagios monitoring for production environments.

Hardware & Storage Performance

Ongoing

Conducted hands-on benchmarking of SATA/SAS RAID controllers including HighPoint RocketRaid 2740 and LSI/SuperMicro AOC-USASLP2-H8iR, comparing against software RAID configurations.

Skills

A small icon representing a server with clean geometric lines in slate blue

Linux Administration

RHEL, SLES, CentOS — package management, kernel tuning, HA clustering, and monitoring integration.

A small icon representing a cloud shape with clean geometric lines in slate blue

Cloud Architecture

AWS EC2, reserved-instance planning, cost modeling, and hybrid infrastructure strategy.

A small icon representing code brackets with clean geometric lines in slate blue

F# & .NET/Mono

Functional programming on OSX, MonoDevelop toolchain, and cross-platform game-dev exploration.

A small icon representing a database cylinder with clean geometric lines in slate blue

PHP & Symfony

Web application development with the Symfony framework and the broader PHP ecosystem.

A small icon representing a storage drive with clean geometric lines in slate blue

Storage & RAID

SATA/SAS controller evaluation, md RAID configuration, and performance benchmarking.

A small icon representing a shield with clean geometric lines in slate blue

High Availability

Pacemaker, STONITH, crm_mon alerting, and Nagios integration for production cluster monitoring.