[SOLVED] NUT Client configuration -> help needed for shutdown Proxmox host

Ronny1978

Member
Mar 13, 2023
68
15
8
Hello Together.

I hope you can help me?

I meet the following requirements:

- Synology DS918+ as NUT Server
- Proxmox host as NUT Client
- APC 1000 with USB connection to Synology DS918+

What works?

- the connection between DS918+ and Proxmox host is established and works
- sending emails from Proxmox host, when NUT connection is lost, established, on batt or online again

What doesn't works?

I want to shut down Proxmox host with "upsmon -c fsd" after 180 seconds after change to ONBATT, but the script doesn't starts. If I execute "upsmon -c fsd" in the Proxmox shell for testing, it works fine. So I think I have a problem with the upssched-cmd. Here me configurations:

nut.conf
Code:
MODE=netclient

upsmon.conf
Code:
RUN_AS_USER root
MONITOR ups@192.168.1.20 1 monuser Secret slave
NOTIFYCMD /etc/nut/notify

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h +0"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE        "UPS %s ist wieder Online"
NOTIFYMSG ONBATT        "UPS %s ist im Akkumodus"
NOTIFYMSG LOWBATT       "UPS %s Batterie ist niedrig"
NOTIFYMSG FSD           "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK        "Kommunikation mit UPS %s ist wieder hergestellt"
NOTIFYMSG COMMBAD       "Kommunikation mit UPS %s unterbrochen"
NOTIFYMSG SHUTDOWN      "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT      "UPS %s Batterie muss ersetzt werden"
NOTIFYMSG NOCOMM        "UPS %s ist nicht erreichbar"
NOTIFYMSG NOPARENT      "upsmon Prozess  - shutdown ist unmöglich"

ONLINE   : UPS is back online
ONBATT   : UPS is on battery
LOWBATT  : UPS has a low battery (if also on battery, it's "critical")
FSD      : UPS is being shutdown by the master (FSD = "Forced Shutdown")
COMMOK   : Communications established with the UPS
COMMBAD  : Communications lost to the UPS
SHUTDOWN : The system is being shutdown
REPLBATT : The UPS battery is bad and needs to be replaced
NOCOMM   : A UPS is unavailable (can't be contacted for monitoring)
NOPARENT : The process that shuts down the system has died (shutdown impossible)


NOTIFYFLAG ONLINE       SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT      SYSLOG+WALL+EXEC
NOTIFYFLAG FSD          SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK       SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD      SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN     SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT     SYSLOG+WALL
NOTIFYFLAG NOCOMM       SYSLOG+WALL
NOTIFYFLAG NOPARENT     SYSLOG+WALL

RBWARNTIME 43200

NOCOMMWARNTIME 180

FINALDELAY 5

upssched.conf
Code:
CMDSCRIPT /etc/nut/upssched-cmd
PIPEFN /etc/nut/upssched.pipe
LOCKFN /etc/nut/upssched.lock

AT ONBATT * START-TIMER onbatt 180
AT ONBATT * EXECUTE onbatt
AT ONLINE * CANCEL-TIMER onbatt online
AT LOWBATT * EXECUTE onbatt
AT COMMBAD * START-TIMER commbad 120
AT COMMOK * CANCEL-TIMER commbad commok
AT NOCOMM * EXECUTE commbad
AT SHUTDOWN * EXECUTE powerdown

upssched-cmd
Code:
#!/bin/sh
case $1 in
onbatt)
logger -t upssched-cmd "UPS running on battery"
/usr/sbin/upsmon -c fsd
;;
earlyshutdown)
logger -t upssched-cmd "UPS on battery too long, early shutdown"
/usr/sbin/upsmon -c fsd
;;
shutdowncritical)
logger -t upssched-cmd "UPS on battery critical, forced shutdown"
/usr/sbin/upsmon -c fsd
;;
upsgone)
logger -t upssched-cmd "UPS has been gone too long, can't reach"
;;
*)
logger -t upssched-cmd "Unrecognized command: $1"
;;
esac

For your help many thanks in advance. Have a nice weekend and please stay healthy.

Ronny
Chemnitz / Germany
 
Hi / Guten tag.
So did you figure out how to run the script for shutdown ? And was it one to close all vm first and the shutdown prox after ?
 
So did you figure out how to run the script for shutdown ? And was it one to close all vm first and the shutdown prox after ?
Yes. The script shutdown all VM's and LXC containers first, then Proxmox shutdown itself. My Synology DS918+ send a wake on LAN command, when the power is replaced. Proxmox send me an email for each step -> (1. Warning shutdown / 2. Shutdown / 3. Lost communication battery / 4. Communication battery rebuild).

It works fine.

Have a nice weekend.

Ronny
 
@Ronny1978 Did you do any further modification to your script? I get the notification that my ups is on battery in sysylog but my proxmox does not shutdown.

Thanks
 
UPSMON.conf
Code:
RUN_AS_USER root
MONITOR ups@ip address NAS 1 monuser secret slave

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h"
NOTIFYCMD /usr/sbin/upssched
POLLFREQ 2
POLLFREQALERT 1
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE    "UPS %s ist wieder online"
NOTIFYMSG ONBATT    "UPS %s ist im Akkumodus"
NOTIFYMSG LOWBATT   "UPS %s Batterie ist niedrig"
NOTIFYMSG FSD       "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK    "Kommunikation mit UPS %s wieder hergestellt"
NOTIFYMSG COMMBAD   "Kommunikation mit UPS %s verloren"
NOTIFYMSG SHUTDOWN  "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT  "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM    "UPS %s ist nicht erreichbar"
NOTIFYMSG NOPARENT  "upsmon parent process died - shutdown impossible"

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL

UPSSCHED.conf

Code:
GNU nano 5.4                                                             upssched.conf                                                                     
CMDSCRIPT /etc/nut/upssched-cmd
PIPEFN /etc/nut/upssched.pipe
LOCKFN /etc/nut/upssched.lock

AT ONBATT * START-TIMER onbatt 600
AT ONLINE * CANCEL-TIMER onbatt online
AT LOWBATT * EXECUTE onbatt
AT COMMBAD * EXECUTE commbad_message
AT COMMOK * EXECUTE commok_message
AT NOCOMM * EXECUTE nocomm_message
AT SHUTDOWN * EXECUTE shutdown_message
AT SHUTDOWN * EXECUTE powerdown

UPSSCHED CMD
Code:
  GNU nano 5.4                                                             upssched-cmd                                                                       
#!/bin/sh

 case $1 in
       onbatt)
          logger -t upssched-cmd "UPS im Akkumodus"
          /usr/sbin/upsmon -c fsd
          ;;
        commbad_message)
          echo "UPS ist nicht mehr verbunden" | mailx -s "Proxmox: UPS Warnmeldung" e-mail address for warning
          ;;
        online)
          logger -t upssched-cmd "UPS wieder Online"
          ;;
        commok_message)
          echo "UPS ist wieder verbunden" | mailx -s "Proxmox: UPS Warnmeldung" e-mail address for warning
          ;;
        nocomm_message)
          echo "UPS ist nicht mehr erreichbar" | mailx -s "Proxmox: UPS Warnmeldung" e-mail address for warning
          ;;
        shutdowncritical)
          logger -t upssched-cmd "UPS on battery critical, forced shutdown"
          ;;
        upsgone)
          logger -t upssched-cmd "UPS has been gone too long, can't reach"
          ;;
        shutdown_message)
          echo "Proxmox wird heruntergefahren" | mailx -s "Promox: UPS Warnmeldung" e-mail address for warning
          ;;
       *)
          logger -t upssched-cmd "Unrecognized command: $1"
          ;;
 esac

Thats work for me.
 
I've modified upssched-cmd so that it automatically uses the root email address and puts the hostname of the Proxmox host in the subject.

Code:
#!/bin/sh

EMAIL=`cat /etc/pve/user.cfg | grep root | awk '{split($0,a,":"); print a[7]}'`
PROXMOXHOST=$(uname -n)

 case $1 in
       onbatt)
          logger -t upssched-cmd "UPS on battery"
          /usr/sbin/upsmon -c fsd
          ;;
        commbad_message)
          echo "UPS is not connected" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        online)
          logger -t upssched-cmd "UPS Online"
          ;;
        commok_message)
          echo "UPS is connected again" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        nocomm_message)
          echo "UPS is not reachable" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        shutdowncritical)
          logger -t upssched-cmd "UPS on battery critical, forced shutdown"
          ;;
        upsgone)
          logger -t upssched-cmd "UPS has been gone too long, can't reach"
          ;;
        shutdown_message)
          echo "Proxmox shutdown" | mailx -s "Promox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
       *)
          logger -t upssched-cmd "Unrecognized command: $1"
          ;;
 esac
 
Thanks for the configuration examples as well as the upssched-cmd examples - that's very helpful (and kinda unexpected that the defaults aren't more... sane/helpful).

Anyways, i kinda got the same setup around here - Synology is the master, connected via USB cable to a Cyberpower UPS.

Question is, if anyone has recommendations how to handle the shutdown order in a 3-server setup with Ceph?

I mean, i can power down one of three without much of a problem - but after that - is there a preferred sequence? Timeouts to configure? Something? :)

Thanks!
 
Yes. The script shutdown all VM's and LXC containers first, then Proxmox shutdown itself. My Synology DS918+ send a wake on LAN command, when the power is replaced. Proxmox send me an email for each step -> (1. Warning shutdown / 2. Shutdown / 3. Lost communication battery / 4. Communication battery rebuild).

It works fine.

Have a nice weekend.

Ronny
Hello. And how this is implemented can be found in more detail: My Synology DS918+ send a wake on LAN command, when the power is replaced
 
Hello @sany_ch ,

I don't know, if I understand you correctly. When the DS918+ has replaced power and starts, after startup it sends via script the following command to proxmox:

Code:
/usr/syno/sbin/synonet --wake 00:e0:4c:88:0d:80 ovs_bond0
 
  • Like
Reactions: sany_ch
When the DS918+ has replaced power and starts
Not sure of use-case scenario, but surely the Synology device has also been (safely) powered down due to a power failure, what brings the Synology device backup automatically, when power has been restored? More likely you want a box-system/OS that isn't affected by sudden loss of power & can be set to always be/turn-back on when power is online. Don't think Synology device cuts the deal.
 
Last edited:
Don't think Synology device cuts the deal.
It does ;-). The Synology gets the information from the USV via USB. Then its send a signal to my Proxmox to shutdown. If the power is replaced, the Synology starts up and starts a script -> WoL to Proxmox Host. Promox started also. It works very well.
 
  • Like
Reactions: gfngfn256
I have tried to get this going with a QNAP and I seem to be stuck somewhere, wondering if someone has seen a similar situation happen.

I can use upsc to talk to the UPS successfully, connected to the QNAP


Code:
root@prox2:/etc/nut# upsc qnapups@10.0.0.104
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.runtime: 1560
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.2
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS C 1000
device.serial: 3S1719X07311
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 10
driver.parameter.port: /dev/ttyS1
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: APC HID 0.96
driver.version.internal: 0.41
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.firmware: UPS 10.0 / ID=1005
ups.mfr: American Power Conversion
ups.mfr.date: 2017/05/13
ups.model: Smart-UPS C 1000
ups.productid: 0003
ups.serial: 3S1719X07311
ups.status: OL
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.vendorid: 051d

I seem to have the service running properly as well - using systemctl


Code:
root@prox2:/etc/nut# systemctl status nut-client
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
     Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-09-18 15:44:37 EDT; 1s ago
   Main PID: 2598402 (upsmon)
      Tasks: 2 (limit: 309110)
     Memory: 852.0K
        CPU: 4ms
     CGroup: /system.slice/nut-monitor.service
             ├─2598402 /lib/nut/upsmon -F
             └─2598403 /lib/nut/upsmon -F

Sep 18 15:44:37 prox2 systemd[1]: Started nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller.
Sep 18 15:44:37 prox2 nut-monitor[2598402]: fopen /run/nut/upsmon.pid: No such file or directory
Sep 18 15:44:37 prox2 nut-monitor[2598402]: Could not find PID file to see if previous upsmon instance is already running!
Sep 18 15:44:37 prox2 nut-monitor[2598402]: UPS: qnapups@10.0.0.104 (secondary) (power value 1)
Sep 18 15:44:37 prox2 nut-monitor[2598402]: Using power down flag file /etc/killpower
Sep 18 15:44:37 prox2 nut-monitor[2598403]: Init SSL without certificate database

And my config files are basically exactly what you have here:

upsmon.conf
Code:
RUN_AS_USER root

MONITOR qnapups@ip.address.of.nut.server 1 monuser secret slave

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h"
NOTIFYCMD /usr/sbin/upssched
POLLFREQ 2
POLLFREQALERT 1
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE    "UPS %s on line power"
NOTIFYMSG ONBATT    "UPS %s on battery"
NOTIFYMSG LOWBATT   "UPS %s battery is low"
NOTIFYMSG FSD       "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK    "Communications with UPS %s established"
NOTIFYMSG COMMBAD   "Communications with UPS %s lost"
NOTIFYMSG SHUTDOWN  "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT  "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM    "UPS %s is unavailable"
NOTIFYMSG NOPARENT  "upsmon parent process died - shutdown impossible"

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL

NOCOMMWARNTIME 10

FINALDELAY 5


upssched.conf
Code:
CMDSCRIPT /etc/nut/upssched-cmd
PIPEFN /etc/nut/upssched.pipe
LOCKFN /etc/nut/upssched.lock

AT ONBATT * START-TIMER onbatt 120
AT ONLINE * CANCEL-TIMER onbatt online
AT LOWBATT * EXECUTE onbatt
AT COMMBAD * EXECUTE commbad_message
AT COMMOK * EXECUTE commok_message
AT NOCOMM * EXECUTE nocomm_message
AT SHUTDOWN * EXECUTE shutdown_message
AT SHUTDOWN * EXECUTE powerdown

upssched-cmd
Bash:
#!/bin/sh

EMAIL=`cat /etc/pve/user.cfg | grep root | awk '{split($0,a,":"); print a[7]}'`
PROXMOXHOST=$(uname -n)

 case $1 in
       onbatt)
          logger -t upssched-cmd "UPS on battery"
          /usr/sbin/upsmon -c fsd
          ;;
        commbad_message)
          echo "UPS is not connected" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        online)
          logger -t upssched-cmd "UPS Online"
          ;;
        commok_message)
          echo "UPS is connected again" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        nocomm_message)
          echo "UPS is not reachable" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
        shutdowncritical)
          logger -t upssched-cmd "UPS on battery critical, forced shutdown"
          ;;
        upsgone)
          logger -t upssched-cmd "UPS has been gone too long, can't reach"
          ;;
        shutdown_message)
          echo "Proxmox shutdown" | mailx -s "Promox ($PROXMOXHOST): UPS Warning" $EMAIL
          ;;
       *)
          logger -t upssched-cmd "Unrecognized command: $1"
          ;;
 esac

nut.conf
Code:
# Network UPS Tools: example nut.conf
#
##############################################################################
# General section
##############################################################################
# The MODE determines which part of the NUT is to be started, and which
# configuration files must be modified.
#
# This file try to standardize the various files being found in the field, like
# /etc/default/nut on Debian based systems, /etc/sysconfig/ups on RedHat based
# systems, ... Distribution's init script should source this file to see which
# component(s) has to be started.
#
# The values of MODE can be:
# - none: NUT is not configured, or use the Integrated Power Management, or use
#   some external system to startup NUT components. So nothing is to be started.
# - standalone: This mode address a local only configuration, with 1 UPS
#   protecting the local system. This implies to start the 3 NUT layers (driver,
#   upsd and upsmon) and the matching configuration files. This mode can also
#   address UPS redundancy.
# - netserver: same as for the standalone configuration, but also need
#   some more network access controls (firewall, tcp-wrappers) and possibly a
#   specific LISTEN directive in upsd.conf.
#   Since this MODE is opened to the network, a special care should be applied
#   to security concerns.
# - netclient: this mode only requires upsmon.
#
# IMPORTANT NOTE:
#  This file is intended to be sourced by standard POSIX shell scripts (so
#  there is no guaranteed `export VAR=VAL` syntax) and by systemd on Linux.
#  You MUST NOT use spaces around the equal sign!

MODE=netclient

# Uncomment this to allow starting the service even if ups.conf has no device
# sections at the moment. This environment variable overrides the built-in
# "false" and an optional same-named default flag that can be set in upsd.conf:
#ALLOW_NO_DEVICE=true
#export ALLOW_NO_DEVICE

If I disable the UPS server on the QNAP, I would expect to see messages regarding loss of power, but I do not see them happening, has anyone come across this?
 
I just have the worst luck on these forums...

So I went and yanked the plug on the UPS as a "test", and came back to the SSH console to my Proxmox server and saw these messages:


Code:
root@prox2:/etc/nut# systemctl status nut-client
● nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
     Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-09-18 15:44:37 EDT; 13min ago
   Main PID: 2598402 (upsmon)
      Tasks: 2 (limit: 309110)
     Memory: 852.0K
        CPU: 45ms
     CGroup: /system.slice/nut-monitor.service
             ├─2598402 /lib/nut/upsmon -F
             └─2598403 /lib/nut/upsmon -F

Sep 18 15:44:37 prox2 systemd[1]: Started nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller.
Sep 18 15:44:37 prox2 nut-monitor[2598402]: fopen /run/nut/upsmon.pid: No such file or directory
Sep 18 15:44:37 prox2 nut-monitor[2598402]: Could not find PID file to see if previous upsmon instance is already running!
Sep 18 15:44:37 prox2 nut-monitor[2598402]: UPS: qnapups@10.0.0.104 (secondary) (power value 1)
Sep 18 15:44:37 prox2 nut-monitor[2598402]: Using power down flag file /etc/killpower
Sep 18 15:44:37 prox2 nut-monitor[2598403]: Init SSL without certificate database

Broadcast message from root@prox2 (somewhere) (Wed Sep 18 16:00:23 2024):

UPS qnapups@10.0.0.104 on battery


Broadcast message from root@prox2 (somewhere) (Wed Sep 18 16:01:13 2024):

UPS qnapups@10.0.0.104 on line power

So it seems to be working, I just need to test it all the way through at this point.

Just like bringing your car to the mechanic...I swear.
 
FWIW Using QNAP, APC SmartUPS and NUT, with a 3 node cluster successfully
1 Host has APC UPS attached via USB, this is the "master" , it shuts down last.
Other 2 Hosts have NUT client installed, QNAP has built in NUT.
FYI QNAP NUT client has "qnapups" hard coded into its NUT setup, have to use this (could hack QNAP /etc/init.d/ups.sh startup but upgrades would be a concern)

All the hosts and QNAP are configured in BIOS to power back on when power returns. I added a long boot wait in Grub on all proxmox hosts in case power goes off again. Also, QNAP takes a long time to power on and shut down so care with timing is required.

But there is another scenario where master host has successfully shut down two of the proxmox cluster and the QNAP but power comes back. The two hosts will stay shut down.

On the "master" NUT host edited /etc/nut/upssched-cmd , added a "wakeon lan" entry under "case$1"

case $1 in
onbatt)
logger -t upssched-cmd "UPS on battery"
/usr/sbin/upsmon -c fsd
;;
commbad_message)
echo "UPS is not connected" | mailx -s "Proxmox ($PROXMOXHOST): UPS Warning" -r $EMAIL $EMAIL
;;
online)
logger -t upssched-cmd "UPS Online "
;;
wakeonlan)
logger -t upssched-cmd "Run wakeonlan commands"
# device
/usr/bin/wakeonlan 00:00:00:00:00
# proxmox host 0 00:00:00:00:00
/usr/bin/wakeonlan 00:00:00:00:00
# NAS
/usr/bin/wakeonlan 00:00:00:00:00
# proxmox host 1
/usr/bin/wakeonlan 00:00:00:00:00
# Proxmox Backup Server 00:00:00:00:00
/usr/bin/wakeonlan 00:00:00:00:00
;;
...
You need to enable wakeonlan in your hardware and Proxmox and edit the mac addresses above to match.

Also need to edit /etc/nut/upssched.conf on the master

CMDSCRIPT /etc/nut/upssched-cmd
PIPEFN /run/nut/upssched.pipe
LOCKFN /run/nut/upssched.lock

# proxmox host 2 is primary - add another minute to shutdown
# Starts a timer when the UPS switches to battery power
AT ONBATT * START-TIMER onbatt 600

# Cancels the shutdown timer when power is restored
AT ONLINE * CANCEL-TIMER onbatt online
# wakeon lan other devices
AT ONLINE * EXECUTE wakeonlan

# Executes immediate shutdown when battery is low
AT LOWBATT * EXECUTE onbatt
...

Regards
Geoffrey
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!