Uninterruptible Power Supply (UPS)¶
UPS setup¶
- Plug devices into critical / noncritical outlet groups, where noncritical outlets get shut down first
OPNsense as Network UPS Tools (NUT) Server¶
Refs:
- https://schnerring.net/blog/configure-nut-for-opnsense-and-truenas-with-the-cyberpower-pr750ert2u-ups/
- https://forum.opnsense.org/index.php?topic=27936.0
-
Install NUT plugin
-
Restart
-
Configure NUT
- General Settings > General Nut Settings
- Name will be used as address for all netclients
- General Settings > Nut Account Settings
- Monitor Password is password for
monuser
account that will be used for all netclients
- Monitor Password is password for
-
UPS Type > USBHID-Driver
- [x] enable
-
Configure NAT: port forward internal traffic hitting firewall IPs port
3493
to127.0.0.1:3493
-
Test
sh upsc <UPS_NAME>@<OPNSENSE_IP>:3493
TrueNAS integration¶
-
Ensure NUT configured on OPNsense (acting as NUT server)
-
On TrueNAS, test with:
sh upsc <UPS_NAME>@<OPNSENSE_IP>:3493
-
Find configuration: System Settings > Services > UPS
-
-
Test that it actually shuts devices down:
sh # from server (OPNsense) upsmon -c fsd
Sample configurations¶
nut.conf¶
MODE=netclient
upsmon.conf¶
MONITOR PR1500RT2U@<opnsense_address>:3493 1 monuser <password> slave
# bsd
; SHUTDOWNCMD "/usr/local/etc/rc.halt"
# linux
SHUTDOWNCMD /sbin/shutdown -h +0
POWERDOWNFLAG /etc/killpower