This is the second half of a two-host setup on one shared UPS (APC Smart-UPS SMT1500RMI2U with an AP9630 network card). Part 1 explains the design and the Proxmox side. In short:
- Every host polls the UPS card directly over SNMP and shuts itself down. No NUT master that everyone depends on.
- Proxmox goes down at 50%, TrueNAS at 40%. The VMs that write to the NAS are stopped before the NAS itself shuts down.
- A read-only SNMP community means no host can cut power to the shared UPS.
Tested on TrueNAS SCALE 24.10 (Electric Eel), NUT 2.8.0. Everything here is done in the web UI, no shell editing needed.
1. Prerequisite: SNMP on the card
SNMPv1 has to be enabled on the AP9630 with a read-only community (public). See Part 1 for the steps. In these examples the card is at 192.168.1.50.
2. Configure the UPS service
System → Services → UPS, click the pencil icon to edit:
| Field | Value | Why |
|---|---|---|
| Identifier | e.g. smt1500 |
Name of the UPS in NUT (used later with upsc) |
| UPS Mode | Master | TrueNAS talks to the card itself; it isn’t a client of another NUT server |
| Driver | APC ups 3 (various) AP9630 SNMP monitoring card (snmp-ups) | There’s no bare “snmp-ups” entry; this preset is snmp-ups with the AP9630 mapping |
| Port or Hostname | 192.168.1.50 |
The card’s IP. Not the default 3493! |
| Monitor User / Password | leave as is | Only used internally between upsd and upsmon |
| Remote Monitor | unchecked | TrueNAS only watches the card; it doesn’t serve other machines |
| Shutdown Mode | UPS reaches low battery | Works together with the override below |
| Shutdown Timer | 30 | Grace period in seconds after low battery |
| Power Off UPS | unchecked | The UPS is shared; TrueNAS must never switch it off |
The classic trap is Port or Hostname. For USB/serial drivers this field holds a device path; for snmp-ups it’s the SNMP target. The preset value 3493 is NUT’s own TCP port and doesn’t belong here. With it the driver looks for an SNMP agent at “3493” and finds nothing.
Auxiliary Parameters (ups.conf)
|
1 2 3 4 5 |
community = public snmp_version = v1 mibs = apcc override.battery.charge.low = 40 ignorelb |
- The first two lines tell the driver how to talk SNMP to the card.
mibs = apccis usually already covered by the AP9630 preset, but setting it explicitly does no harm. Add it at the latest if the connection works but the values come back empty.override.battery.charge.low = 40plusignorelbmake NUT raise low-battery itself at 40%, instead of waiting for the UPS’s own (much later) flag. This is the TrueNAS threshold; Proxmox has 50.
Save, set the service to Running and tick Start Automatically.
3. Verify
In the TrueNAS shell (System → Shell):
|
1 2 3 4 |
upsc smt1500@localhost battery.charge # current charge upsc smt1500@localhost battery.charge.low # must be 40 upsc smt1500@localhost ups.status # OL = on line power upsc smt1500@localhost driver.version.data # e.g. "apcc MIB 1.6" |
If you get a live percentage, TrueNAS is talking to the card. A timeout almost always means: wrong IP in the Port field (still 3493?), routing/VLAN, or SNMPv1 not enabled on the card.
Side note: Reports → UPS may stay empty for a while. That says nothing about whether the shutdown works; upsc is the reliable check.
4. Notifications
Don’t hand-edit upsmon.conf on TrueNAS. The UPS service is managed by the middleware and the files get regenerated on every service restart or update. Use TrueNAS’s own Alert Settings instead (System → Alert Settings). They fire on UPS events natively and survive updates. Email works out of the box; there are also services for Slack, Telegram and Mattermost, among others.
Since both hosts sit on the same UPS, the Proxmox notifier from Part 1 already reports the power cut itself. On TrueNAS the useful extra signal is mainly “TrueNAS is at 40% and shutting down now”.
Pitfalls
- Port field left at 3493: the most common mistake. It has to be the card’s IP.
- Power Off UPS enabled: on a shared UPS, that would cut power to everything else.
- Thresholds the wrong way round: TrueNAS has to go down after the hosts that write to it, so give it the lower percentage.
- Hand edits in /etc/nut: overwritten on the next restart. Everything belongs in the UI fields and the Auxiliary Parameters.
- BIOS: enable “power on after AC loss”, or the NAS stays off when the power comes back.
Testing
As in Part 1: in a maintenance window, pull the UPS’s mains plug (or simulate a power failure from the card) and watch the order. Proxmox goes down at 50% while TrueNAS keeps serving its shares, and TrueNAS follows at 40%. That’s the only way to know the shutdown really works, not just that the config looks right.