NUT on OpenWrt

Here are the steps I took to set up NUT at home between a NAS (server) and an Openwrt router (client).

First, on the NUT server, make sure it is set with MODE=netserver.

Next, add the folowing directive for the client:

In /etc/nut/upsd.conf you should add

LISTEN 192.168.1.2 #IP of the client

Next, on the client:

Make sure you have installed nut-client which is the useful package for this use case.

Inside /etc/nut/nut/nut.conf, make sure there is MODE=netclient.

In $HOMEBREW/nut/config/nut-monitor (or something similar) you should have the following rules:

config slave
   option upsname ups
   option hostname 192.168.1.1
   option username upsmon
   option password secret

Replace upsname, hostname, username and password with the settings on the NUT server (thoses should be in /etc/nut/upsd.user).

Type upsmon -D in the terminal of the client and check for errors (may need to stop it first as it can’t start more than one time).

This should generate the /etc/nut/upsmon.conf file.

Some docs says to use upsdrvctl -t shutdown. It didn’t work on my system but good to know to try to simulate a shutdown (without actually powering off).

If everything work so far, try the next command (make sure to save all works as this will power off the client):

upsmon -c fsd

NUT should be set up now.

Links to this page
#openwrt #nut #nas