nut - where to configure shutdown sequence

Started by tessus, November 14, 2021, 08:59:37 PM

Previous topic - Next topic
I've configured nut (via the plugin Services -> Nut) and the diagnostic panel shows all the UPS info. So far so good.

But how do I configure the OPNsense machine to shutdown after a certain amount of time? There are no config options in the plugin UI.
I don't have a problem doing this via an SSH session, but there's no info in the docs that one has to do that.

In a normal setup, I'd just change the upsmon.conf and start upsmon. But this is a hardened system and a few things work differently than on "regular" systems.

This is a plugin, so I don't know if asking a question on this forum is appropriate, in which case please direct me to the right place.

Currently not possible, it should shutdown when reaching 10% battery

Thanks a lot for your reply.

Is there any chance you can add this info to the docs and even the plugin?

The system will shutdown when 10% battery is reached.

Right now a person who uses the nut client knows nothing except that there's info from the UPS. But that alone is pretty much useless. The reason why one wants to connect to a UPS is that the machine is safely shutdown.



Thx, saw the PRs, is there a chance to verify this too? If I remember crlorrectly I read about the 10% in some other issue

Sorry, not on my end. I have production machines on my UPS and they will shutdown sooner than at 10% remaining battery level.

But I might change the wording, because the nut client will shutdown the machine when the UPS emits a low battery warning. This might be at 10% or not. I thought you have set the 10% threshold specifically but nothing in the nut config files confirms that.

November 16, 2021, 03:42:14 PM #7 Last Edit: November 16, 2021, 04:56:51 PM by gpb
In a real world situation I witnessed and stood there helplessly watching at 3 AM hoping my gear would shutdown because I had no way to manually intervene.  A low battery alert was sent to both OPNsense and one of my RPi hosts from the nut-server and the log shows it was received by each.  You can see the RPi initiates a shutdown, but nothing for OPNsense.  I don't see what I would have expected to see like a sigterm or any message, but the log just stops and then we can see the boot up sequence hours later.  Yet on the nut-server there was ample time to initiate the shutdown...so the UPS didn't simply die.  This was months ago and I can't remember exactly which log in opnsense has this info.

In the rpi-1 shutdown sequence, the time between low-battery alert and the message "Giving up on the master..." is defined by the parameter DEADTIME in UPSMON.conf...in my case I have it set to 15 seconds which you can verify in the log.  That parameter is missing from the OPNsense config...I think it needs to be included as an option...does it even have a default value?  Still, it's a mystery what OPNsense did because the repeating 30 second message from DHClient also stops before the ups is shutdown.  Anyhow that's my personal experience.  There was no data corruption so...yay.  :)

Edit: Another important value in upsmon.conf is FINALDELAY (missing in the opnsense config).  BTW, I should note I'm not an expert on this.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

November 16, 2021, 03:43:21 PM #8 Last Edit: November 16, 2021, 07:54:14 PM by gpb
Here is the log from the other nut client referred above.  Btw, I do remember reading that this can be simulated as a test without having a dead ups...I need to track that down when I get time.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT