networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
1.93k stars 346 forks source link

upsmon: add ALARM support #415

Open aquette opened 7 years ago

aquette commented 7 years ago

As per http://lists.alioth.debian.org/pipermail/nut-upsuser/2017-April/010591.html

Add support for the ALARM flag in ups.status to upsmon

Development tracked in https://github.com/networkupstools/nut/tree/upsmon_alarm

Luo2Jie2 commented 7 years ago

I think it would be better to handle the general case first, by implementing a fall-through of "UNKNOWN" so that all status changes, no matter how weird, can be caught.  Such a catch-all would also have caught the "ALARM" in the specific case raised in the mailing list.

Later, specific new values can be added after a more thorough discussion of the real needs.

Roger

aquette commented 7 years ago

thanks for all your comments @Luo2Jie2 . ALARM support is to me a good step, which was really missing, and which covers the base status. However, I agree that this filters out "OTHER" (better wording than "UNKNOWN", no?) status changes. We may consider that for a 2nd step.

Calling to @clepple , @zykh , @jimklimov for comments...

Luo2Jie2 commented 7 years ago

"OTHER" is certainly a better name than "UNKNOWN" for a catch-all. Roger

clepple commented 7 years ago

I don't want to sound like I am nit-picking on the name, but if we were to implement a catch-all, wouldn't it be better to make it match everything rather than things not explicitly named? Then it should be possible to have the user-provided notification script do the filtering, without worrying if the notification name has changed at some point.

Also, as of revision f7de20aee, there is an unused variable warning in Buildbot.

aquette commented 6 years ago

postponing to 2.7.6 to have time for the right considerations on this point...