In this article
Parse every NUT status token and preserve query validity; input-line flags, battery condition and shutdown policy are separate observations.
A UPS collector recognizes only an exact status string and misses a low-battery condition when another flag is present. NUT ups.status is a space-separated token set, not one closed scalar state. Preserve concurrent flags and query failures before translating them into a power-condition summary for an inference node.
Parse the complete token set
NUT documents source-state tokens alongside battery, overload and other indicators. A combination can carry several independent facts. Split the supported representation and evaluate recognized tokens without rejecting an unfamiliar addition. Keep the original string for diagnostics. An unknown token does not authorize discarding known critical information or coercing the entire observation to a healthy default.
Separate input from protection
OL and OB describe input-line status under the documented contract. They do not by themselves establish the load’s complete protection or battery health. Other flags can indicate bypass, overload, replacement need or forced shutdown. A display that labels every observation containing OL as fully protected erases those conditions and can misrepresent the state the monitoring system actually reported.
Preserve communication outcomes
A successful read-only query reports data from the selected NUT server and device name. Connection failure, stale information and an explicit device state are different observations. Do not retain an old healthy value indefinitely when current acquisition fails. Preserve collection time and device identity so switching server endpoints cannot silently join unrelated UPS histories under one convenient node label.
Keep shutdown policy separate
The collector’s summary is not the shutdown controller’s complete decision. Protected equipment, monitor configuration and supported recovery behavior remain separate dependencies. Reading a flag neither initiates nor proves successful shutdown. Record which component observes the condition and which component owns the response. This guide does not send hardware commands or simulate a power interruption on an occupied node.
Verify transitions with fixtures
Provide single and combined flags, unknown tokens, missing data and a transition from battery operation back to normal input in an isolated parser test. Verify that current evidence remains distinguishable from retained history. A useful result prevents lost status information. It does not guarantee battery runtime, certify electrical continuity or establish application readiness merely because the source-line status returned to its ordinary state.
Primary references
Network UPS Tools Standard Variables.
Network UPS Tools Status Token Contract.
Network UPS Tools Read-Only Query Client.
Related reading: UPS runtime for a GPU node: a recovery-time budget; GPU networking and availability: beyond internet speed.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.