[Nut-upsuser] How to handle flags as status?
Roger Price
roger at rogerprice.org
Tue Dec 29 21:20:08 GMT 2020
On Tue, 29 Dec 2020, Charles Lepple via Nut-upsuser wrote:
> On Dec 29, 2020, at 9:54 AM, Shakil Shaikh via Nut-upsuser wrote:
>> Are clients therefore supposed to list all possibilities, or split on space
>> to get the flags back?
> Clients should split on space. I remember we had a better description of this
> from the protocol perspective, but that description does not seem to be in the
> current documentation (which has a description aimed at driver developers).
I don't know Prometheus, but if you are going to have it talk to upsd
directly, then you will need to
1. Maintain in Prometheus the current state of the UPS.
2. Every 5 seconds, read the new status and charge from upsd.
3. Compare the new status with the previous status to detect events. E.g.
OL->OB or nil->LB or charge falls below some limit. Based on these events you
issue messages, and perhaps call for a system shutdown.
Does Prometheus provide scripting support?
If Prometheus talks to upsd over some network, then you will need to think about
network security.
Roger
More information about the Nut-upsuser
mailing list