# NUT slave upsmon.conf — Proxmox nodes
# Place at /etc/nut/upsmon.conf on each Proxmox node.
# Replace <NUT_MASTER_IP>, <NUT_SLAVE_PASSWORD> before deploying.
#
# This configures the node as a NUT slave that listens for FSD signals
# from the NUT master. On FSD, it runs the shutdown script which
# stops all VMs/CTs gracefully, then powers off the node.

MONITOR apc@<NUT_MASTER_IP> 1 upsslave <NUT_SLAVE_PASSWORD> slave

MINSUPPLIES 1
SHUTDOWNCMD "/usr/local/bin/ups-shutdown.sh"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG "/etc/killpower"
OFFDURATION 30
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5

NOTIFYFLAG ONLINE SYSLOG+WALL
NOTIFYFLAG ONBATT SYSLOG+WALL
NOTIFYFLAG LOWBATT SYSLOG+WALL
NOTIFYFLAG FSD SYSLOG+WALL
NOTIFYFLAG SHUTDOWN SYSLOG+WALL
NOTIFYFLAG COMMOK SYSLOG
NOTIFYFLAG COMMBAD SYSLOG+WALL
