Update upsmon ALARM support and related themes from issue #415#2709
Update upsmon ALARM support and related themes from issue #415#2709jimklimov merged 34 commits intonetworkupstools:masterfrom
Conversation
Add general support for alarms to upsmon, which relates to the ups.status variable of a device holding the flag "ALARM". upsmon now has a "notify type" alarm, which allows to react on such events, as with other events Signed-off-by: Arnaud Quette <[email protected]>
Whenever a device publishes the ALARM flag in ups.status, the CGI will publish it part of the Status Signed-off-by: Arnaud Quette <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…kupstools#415 discussion adding to PR networkupstools#2658 changes Previously merged-in the couple of commits from issue networkupstools#415 proposal at https://github.com/networkupstools/nut/tree/upsmon_alarm for posterity, now cherry-picking some changes and further discussion ideas from mailing list thread at http://lists.alioth.debian.org/pipermail/nut-upsuser/2017-April/010591.html Closes: networkupstools#415 Signed-off-by: Jim Klimov <[email protected]>
…: handle STATUS_BIT(NOBATTERY) to also status_set("RB") [networkupstools#415]
Signed-off-by: Jim Klimov <[email protected]>
…further strings if we had a match; report unexpected tokens [networkupstools#415, networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
|
NOTE: This PR currently stops short of actually handling the notifications, as we would need some sort of Probably this can be done with dstate/sstate and a catch-all method similar to |
…an extra arg into formatting strings with two "%s" placeholders [networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
…or unknown tokens in `ups.status` [networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
….status` flag tokens [networkupstools#2708] Signed-off-by: Jim Klimov <[email protected]>
…_is_alarm() notification [networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
…e-notify [networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
…aceholders [networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
|
Updated with more comprehensive Note that unlike most other notifications about change of UPS status, the "OTHER"/"NOTOTHER" events do not map to a specific The napkin logic makes sense to me and compiles, but was not tested - that would be most welcome :D |
|
Verified with Console messages: Using It seems to lock up after handling "NOTOTHER" though "ALARM/NOTALARM" handling behaves well, investigating. UPDATE: Small but important bug found, fixed :) |
…networkupstools#415] Signed-off-by: Jim Klimov <[email protected]>
…fall back to /dev/shm or /tmp otherwise [networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
…tworkupstools#2709] ...default the latter to `testgroup_sandbox_upsmon_master` now (includes the earlier `testcase_sandbox_start_drivers_after_upsd`) Signed-off-by: Jim Klimov <[email protected]>
…th longer delay [networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
….notifyme-debug where possible [networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
…once() [networkupstools#1590, networkupstools#2136] Signed-off-by: Jim Klimov <[email protected]>
…mely high verbosity level is on) [networkupstools#1070] Signed-off-by: Jim Klimov <[email protected]>
…originally opened it [networkupstools#1070] Signed-off-by: Jim Klimov <[email protected]>
…tor_status also if exit_flag gets raised (e.g. Ctrl+C during the wait) [networkupstools#1070] Signed-off-by: Jim Klimov <[email protected]>
…etween main loop cycles [networkupstools#1070] Signed-off-by: Jim Klimov <[email protected]>
…ic messages if upsname==NULL [networkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
…networkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
… from time_t to more precise timeval [networkupstools#1070] Signed-off-by: Jim Klimov <[email protected]>
…ic messages if upsname==NULL [networkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
…networkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
Kudos to `make check-NI-sandbox-devel` and LD_LIBRARY_PATH=`pwd`/clients/.libs valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./clients/.libs/upsmon -F Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
…ID that originally opened it [networkupstools#1070]" This reverts commit a6496a6: close from a child process does not seem to impact parent, but a non-close is a memory leak when such child exits. Signed-off-by: Jim Klimov <[email protected]>
…FLAG targets Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#415, networkupstools#2709] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
|
Had some fun with |
Closes: #415
Follow-up to: #2658
Touches on: #2708