[Nut-upsuser] How to handle flags as status?

Shakil Shaikh
2020-12-29T14:54:58Z

I'm looking into the best way to handle the ups status that gets returned by
NUT. I've had a brief look at the source and it appears that this status is
actually a composite of flags, some of which cannot co-exist.

In particular I have a UPS that returns both OL and OL TRIM, which seem like
reasonable statuses, but encode multiple states. A monitoring client has to know
that OL TRIM implies online.

I assume that not all combinations of flags exist, but I also understand that
the combinations that do are defined by the drivers. To that end it becomes
difficult to enumerate them.

Are clients therefore supposed to list all possibilities, or split on space to
get the flags back?

Thoughts appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20201229/84c5d9fc/attachment.html>