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.66k stars 333 forks source link

upsmon: introduce `OBLBDURATION` config toggle #2406

Closed jimklimov closed 1 month ago

jimklimov commented 1 month ago

Largely follows in the footsteps of #2104 which introduced the OFFDURATION toggle.

This PR adds an OBLBDURATION toggle to delay issuing FSD (primary) or commencing a shutdown after HOSTSYNC (secondary without a seen FSD alert), for users that deem this desirable (some use-cases suggested in issue #321 discussion - primarily to survive short hiccups that happen at the wrong moment) at their discretion and risk of an ungraceful shutdown.

Closes: #321

CC @desertwitch @dark-penguin @clepple @aquette

Testing in practice would be as welcome as code review :)

desertwitch commented 1 month ago

Hello Jim, thanks for your effort, I've tested all scenarios (OBLBDURATION -1, OBLBDURATION 0, OBLBDURATION 30, OBLBDURATION not set) and can confirm everything is working as it should. Code-review looking good and reasonable too, the increased polling frequency and countdown-style warning messages are an informative and useful touch. Rysz