Skip to content

Monitoring‐only NUT clients

Jim Klimov edited this page May 2, 2024 · 1 revision

A frequent question is:

Is it possible to put a NUT driver to something like a "read only" or "monitor only" mode in respect to the communication with the hardware? The idea would be to not allow NUT to switch off the power at the UPS at all.

On one hand, it would generally help to read up the documentation about NUT architecture, seeing as it is a crucial part of your systems' uptime and data integrity.

On another hand, for this particular use-case: it is quite possible to set up monitoring-only systems which only inform you if some other NUT data server has had interesting situations, or mixed-monitoring systems for that matter.

The software part of NUT responsible for actually shutting down a computer is typically the upsmon client, whose SHUTDOWNCMD setting (in upsmon.conf) defines how to go about the routine. NUT drivers do interact with devices (and can send power-off commands to supported UPSes in case of killpower flag being processed), but they do not make the decision to do so - the upsmon client running on that box does, based on it being the primary (ex-master) system for the UPS meaning it has the physical media to talk to the device (serial/USB/networked/...). An upsmon client running in "primary/master" mode on the system that can actually talk to the UPS would have a MONITOR line with specification of how many PSUs of this server that UPS feeds (1 or more) and a MINSUPPLIES line to specify how many PSUs (1+) should be fed to consider the server capable of running indefinitely as far as having power is the question. On redundant servers you can have something like "1 of 2 is okay", or "1..3 out of 4" depending on the blade chassis population, etc. When the situation gets critical, a "primary" upsmon client would set the local KILLPOWER flag which would cause the OS late-shutdown scripts (where supported) to run a driver instance talk to the UPS again and tell it to power off and recycle when safe to do so (and thus avoid the "power race condition" where the wall power comes back while half of your rack is already down, so it sits for days waiting for someone to power all servers back on).

As far as monitoring-only clients are concerned, you can set the argument to the MONITOR line un upsmon.conf, that the tracked (and often "secondary") UPS feeds zero (0) power sources of this particular monitoring box, which makes sense if it sits in a different building for example. Orthogonally to that, you can also specify MINSUPPLIES 0 to a purely monitoring system, impacting the trigger for its own shutdown (as long as that many PSUs are fed, all is okay). In a mixed system, having its own UPS(es) and monitoring some remote NUT data servers, you would have a mix of "local" MONITOR lines with a non-zero count of PSUs fed (summing up to your MINSUPPLIES for a healthy uptime) and other MONITOR lines with the zero amount of fed PSUs.

Clone this wiki locally