1

OS: Ubuntu 20.04 NUT: 2.7.4-11ubuntu4 amd64

Is there a way to setup the upsmon.conf (or other non-programmatic way) so that the SHUTDOWNCMD command is based on some expression? Example: I want the OS to gracefully shutdown some time x mins after switching to UPS power only (i.e. Utility power has failed). The current behavior seems to be only one method where it shuts down after the UPS reports a "batter low" condition, but I want to shut down long before that condition.

Chris
  • 11

1 Answers1

0

I think this is an important question, especially in a multi user environment.

It's good to know that the default is 5 seconds which is very short.

Use the FINALDELAY configuration directive in upsmon.conf. usage:

FINALDELAY seconds

from the manpage:

       When running in master mode, upsmon waits this long after sending the NOTIFY_SHUTDOWN to warn the users. After the timer elapses, it then runs your
       SHUTDOWNCMD. By default this is set to 5 seconds.
   If you need to let your users do something in between those events, increase this number. Remember, at this point your UPS battery is almost depleted, so
   don’t make this too big.

   Alternatively, you can set this very low so you don’t wait around when it’s time to shut down. Some UPSes don’t give much warning for low battery and will
   require a value of 0 here for a safe shutdown.

Joshua K
  • 313