Table of Contents
opnSense NUT Client
There is some pretty good documentation at https://docs.opnsense.org/manual/how-tos/nut.html, though a few things caught me. I'm writing this up as a short recipe; see that documentation for the real way to do things.
Recipe
- Install the NUT client by going to System | Firmware and installing os-nut
- Configure at Services | Nut | Configuration (you may need to hit a different page to update your menu, I click on Lobby first)
- General Settings
- Enable Nut
- Service Mode: netclient
- Name: the name on the nut server of the ups. Do not put the server name here, just the stuff before the @
- Listen Address: The IP on the router that has the interface you want to listen on. Probably your LAN IP.
- Click down arrow on UPS Type and select Netclient
- Enable netclient
- IP Address: IP of the NUT server
- Port: Port the NUT server is listening on
- Username: the user name you have defined on the NUT server
- Password: the password you have defined on the NUT server
- Click Apply
- Click Diagnostics and wait up to 20 seconds. If everything is correct, you will see a list of variables from the UPS (as given by the NUT server).
Caveats
The opnSense NUT client has a lot of presets. For example, it is designed to shut down the firewall when LOWBATT is detected (I think at ups.status), which is generally set to about 10%.
opnSense logs problems to /var/log/system/latest.log with a process name of upsmon. So, the command
grep upsmon /var/log/system/latest.log
will show any issues.
The configuration files are stored in /usr/local/etc/nut, so you an actually make manual edits there, but they are not guaranteed to survive an update. upsmon.conf appears to be the only configuration file with anything in it (other than comments) when you are set up as a netclient