Frequently Asked Question
NUT (Network UPS Tools) Setup on Proxmox
Purpose: This guide configures NUT to monitor an SNMP-enabled UPS (such as Riello, APC, etc) on Proxmox, allowing for graceful shutdown during power events.
1. Installation
Install the required NUT packages:
apt install nut nut-snmp
2. Configuration Files
2.1 Main NUT Configuration
/etc/nut/nut.conf
MODE=netserver
netserver mode allows NUT to serve UPS data to network clients.
2.2 UPS Definition
/etc/nut/ups.conf
[myups] driver = snmp-ups port = 10.1.1.29 community = public desc = "Riello UPS" override.battery.charge.low = 30
Note: Replace 10.1.1.29
with your UPS IP address. Change community
if your UPS uses a different SNMP community string.
2.3 UPS Daemon Configuration
/etc/nut/upsd.conf
LISTEN 0.0.0.0 3493
This allows the UPS daemon to listen on all interfaces on port 3493.
2.4 User Authentication
/etc/nut/upsd.users
[upsadmin] password = BadBadBattery! actions = SET actions = FSD instcmds = ALL upsmon master [upsuser] password = ItsDark! upsmon slave
Security: Change these default passwords! The upsadmin
user has full control, whilst upsuser
is for monitoring only.
2.5 UPS Monitor Configuration
/etc/nut/upsmon.conf
MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" POLLFREQ 5 POLLFREQALERT 5 HOSTSYNC 15 DEADTIME 15 POWERDOWNFLAG /etc/killpower RBWARNTIME 43200 NOCOMMWARNTIME 300 FINALDELAY 5 RUN_AS_USER root MONITOR myups@localhost 1 upsadmin BadBadBattery! master NOTIFYCMD /usr/sbin/upssched
3. Key Configuration Parameters
- MINSUPPLIES 1: Minimum number of UPS units required
- SHUTDOWNCMD: Command executed during shutdown
- POLLFREQ 5: Poll UPS every 5 seconds (normal operation)
- POLLFREQALERT 5: Poll frequency during alerts
- DEADTIME 15: Seconds before declaring UPS dead
- RBWARNTIME 43200: Replace battery warning (12 hours)
4. Starting Services
After configuration, start and enable the NUT services:
systemctl start nut-server systemctl start nut-monitor systemctl enable nut-server systemctl enable nut-monitor
5. Testing
Verify the setup is working:
upsc myups@localhost
This should display UPS status information including battery charge, load, and input voltage.
6. Troubleshooting
- Check logs:
journalctl -u nut-server
andjournalctl -u nut-monitor
- Verify SNMP connectivity:
snmpwalk -v1 -c public 10.1.1.29
- Test UPS driver:
/lib/nut/snmp-ups -a myups
Important: Test the shutdown procedure during a maintenance window to ensure Proxmox shuts down gracefully when the UPS battery is low.