Configuring NUT UPS Monitor on TrueNas and Debian

So, I recently had a UPS I was setting up that had USB monitoring. I had planned on connecting this to the TrueNAS system I have running. This setup was rather simple using the UPS service that’s built into TrueNAS. The UPS I had was an APC Tower UPS 1500VA – It took a few attempts to find the right driver, but one of the 1500VA drivers worked for my particular UPS – Usually, it’s a usbhid-ups driver.

After configuring the service with the below settings I moved onto configuring a network client to monitor the TrueNAS UPS through the network.

The UPS I have setup has a power borad connected to it that then powers several smaller PCs – All well within the UPS ratings – So, rest assured I wont blow any fuses.

I found it was important to specify the LISTEN addresses for Auxlary Paramters upsd.conf section. Here I’ve configured my NAS’s IP and Localhost address.

Debian / Ubuntu / General NUT UPS Configuration

So, once you’ve got the nut-client installed with

sudo apt install nut-client

It’s a matter of configuring the service and configuration files.

So, firstly run the following commands on nut-monitor and nut-client as demonstrated in this article with x11 as an example.

Now, remember, only run the following commands in the Ask Ubuntu post as linked if it returns symbolic link to /dev/null. If not, move on.

Once the service is now no-longer /dev/null we can configure the settings files.

nano /etc/nut/upsmon.conf

In upsmon.conf find the lines like below:

# MONITOR myups@bigserver 1 monmaster blah master
# MONITOR [email protected] 1 upsmon secretpass slave
# MONITOR myups@localhost 1 upsmon pass master (or slave)

Add the following line directly below it

MONITOR [email protected] 1 upsmon fixmepass slave

Note – Change the IP Address to your TrueNAS IP address – the upsmon is the username and fixmepass is of course the password.

Next, save that file and edit: /etc/nut/nut.conf

Change the MODE line to MODE=netclient

Finally, start the nut-client service with

sudo service nut-client start

You can check the service is running with sudo service nut-client status

Finally, test the service by running on the MASTER (The TrueNAS) upsmon -c fsd from console.

Note – this will shutdown your NAS and all other clients you have configured to monitor the UPS Master – Your TrueNAS.