Skip to content

Uninterruptible Power Supply (UPS)

UPS setup

  1. 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
  1. Install NUT plugin

  2. Restart

  3. Configure NUT

  4. General Settings > General Nut Settings
    • Name will be used as address for all netclients
  5. General Settings > Nut Account Settings
    • Monitor Password is password for monuser account that will be used for all netclients
  6. UPS Type > USBHID-Driver

    • [x] enable
  7. Configure NAT: port forward internal traffic hitting firewall IPs port 3493 to 127.0.0.1:3493

  8. Test

sh upsc <UPS_NAME>@<OPNSENSE_IP>:3493

TrueNAS integration

  1. Ensure NUT configured on OPNsense (acting as NUT server)

  2. On TrueNAS, test with:

sh upsc <UPS_NAME>@<OPNSENSE_IP>:3493

  1. Find configuration: System Settings > Services > UPS

  2. TrueNAS config

  3. 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