HowTo: Hack NUT to send zpool status & abort scrubs/resilvers if running on battery

Status
Not open for further replies.

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
It seems like there should be a way to add custom scripts for NUT using the GUI, but maybe I'm missing something.
There isn't.

Also, the extra power used during those activities will drain the UPS battery much faster. I'm not sure how "gracefully" those processes are aborted during a "shutdown -p", so I figured it would be a bit safer to just stop them before power gets too low.
I believe a shutdown -p handles it fine. A scrub will certainly drain the battery faster though.

NOTE: I'll have to look closer at the script for 8.3.1-p2 and see what needs changing. It shouldn't be too much different, so I'll post an update.
I submitted the missing event timers and cleaned-up/streamlined custom-upssched-cmd. As a consequence of that your existing code in 8.3.1-p2 would trigger for NOCOMM, FSD, LOWBATT, ONBATT, ONLINE, REPLBATT, SHUTDOWN, COMMBAD (if it timed out) and COMMOK (if COMMBAD timed out). IMHO, which makes it not very elegant. All of those are actually edge cases except for ONBATT, COMMBAD and COMMOK and the last two shouldn't be firing all the time.

If in addition you modify ix-ups you can obtain a more elegant solution.
 
Status
Not open for further replies.
Top