sysutils/nut: add support for timed shutdown with upssched
Important notices Before you add a new report, we ask you kindly to acknowledge the following:
- [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- [x] When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
- I don't feel comfortable waiting to shutdown my devices until the battery of the UPS is low, because it leaves me without a properly working UPS when multiple outages occur before the batteries are charged again.
- My setup is too complex to wait for LB / FSD to be triggered on the master for all clients at the same time, because the clients need to power down in a certain order. I achieve this by configuring upssched on the clients accordingly.
- If I configure upssched on the clients to trigger a timed shutdown, I need to make sure the UPS is shutdown even if the power comes back before LB is reached, to assure everything comes back up automatically again (having 'ondelay' and 'offdelay' configured properly for the UPS and 'restore power on AC return' for the clients).
Describe the solution you'd like
- Add NOTIFYFLAG [...] EXEC lines for ONLINE, ONBATT to upsmon.conf
- Add a template for upssched.conf including a shutdown timer
- Add a template for /usr/local/bin/upssched-cmd accordingly
- Add config options for the shutdown timer to the WebUI ('enabled' and 'delay in seconds')
Describe alternatives you've considered Configure it via CLI (does not survive updates).
Additional context NUT Configuration Examples by Roger Price
I've got this running with a Raspberry Pi as master and I'll be happy to help working on a PR for OPNsense if it has a chance to get merged.
+1
The only reason I use net client instead of standalone on OPNsense is the lack of a timed shutdown option in the UI.
This issue has been automatically timed-out (after 180 days of inactivity).
For more information about the policies for this repository, please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.
If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.