Error when setting up TrueNAS as UPS slave

Hi.

I’ve got a separate system as master for my ups and would like to set up truenas scale as a slave. After doing the setup (details below) I’m getting the following error in /var/log/daemon.log:

Sep 21 08:31:14 truenas systemd[1]: nut-driver@ups.service: Scheduled restart job, restart counter is at 8268.
Sep 21 08:31:14 truenas systemd[1]: Stopped nut-driver@ups.service - Network UPS Tools - device driver for ups.
Sep 21 08:31:14 truenas systemd[1]: Starting nut-driver@ups.service - Network UPS Tools - device driver for ups...
Sep 21 08:31:14 truenas nut-driver@ups[265960]: FATAL: The '/etc/nut/ups.conf' file does not exist or is not readable
Sep 21 08:31:14 truenas nut-driver@ups[265959]: FATAL: Could not find a NUT device section for service unit ups
Sep 21 08:31:14 truenas systemd[1]: nut-driver@ups.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 08:31:14 truenas systemd[1]: nut-driver@ups.service: Failed with result 'exit-code'.
Sep 21 08:31:14 truenas systemd[1]: Failed to start nut-driver@ups.service - Network UPS Tools - device driver for ups.

I tried touch ups.conf; chown root:nut ups.conf, but I then got a similar error saying that the file was empty. Opening a shell in TrueNAS and running upsc ups@10.17.17.10:3493 successfully connects to the ups.

On my master system I’ve added the following to upsd.users and restarted:

[truenas]
password = <redacted>
upsmon slave

and my truenas UPS service looks like this:

All fields below that are left as default or empty.
Shutdown mode: UPS goes on battery
Shutdown Timer: 30
Host Sync: 15
Power off UPS: Disabled
Everything else: empty

Hi,

have you ever solved this issue.

I just installed my TNS and running in the same error.
Ihc got a NUT-Server running on my pfsense.

So I want to connect as slave from TNS. CLI looks fine with the command upsc Ellipse-Pro-650@10.10.10.1:3493.

But logging says

2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=error
Failed to start nut-driver@ups.service - Network UPS Tools - device driver for ups.
2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=warning
nut-driver@ups.service: Failed with result 'exit-code'.



2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=notice
nut-driver@ups.service: Control process exited, code=exited, status=1/FAILURE
2025-03-09 23:54:08.388	
appname=nut-driver@ups
facility=daemon
procid=2897370
severity=informational
FATAL: Could not find a NUT device section for service unit ups
2025-03-09 23:54:08.388	
appname=nut-driver@ups
facility=daemon
procid=2897378
severity=informational
FATAL: The '/etc/nut/ups.conf' file does not exist or is not readable
2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=informational
Starting nut-driver@ups.service - Network UPS Tools - device driver for ups...
2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=informational
Stopped nut-driver@ups.service - Network UPS Tools - device driver for ups.
2025-03-09 23:54:08.388	
appname=systemd
facility=daemon
procid=1
severity=informational
nut-driver@ups.service: Scheduled restart job, restart counter is at 50383.
2025-03-09 23:53:57.887	
appname=snmpd
facility=daemon
procid=2511
severity=informational
systemstats_linux: unexpected header length in /proc/net/snmp. 237 != 224

Did anyone find a fix for this? Our local energy provider has a fault on their network and we keep getting power cuts so I need to get this sorted out.

I believe I manually edited the files in /etc/nut. It was a while ago though so I can’t tell you for sure what I did to solve it, but it does appear to work now. I still cannot see any UPS stats in the reporting menu, I assume that would require it to be the master, but the NAS does power down during a power outage. Here are the contents of those files as they look for me right now:

/etc/nut/nut.conf

MODE=netclient

/etc/nut/upsmon.conf (replace ‘ups’, the ip address, username and password with your equivalents)

MONITOR ups@192.168.1.10:3493 1 username password SLAVE
NOTIFYCMD /usr/sbin/upssched
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG COMMBAD SYSLOG+EXEC
NOTIFYFLAG COMMOK SYSLOG+EXEC
NOTIFYFLAG REPLBATT SYSLOG+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
SHUTDOWNCMD "/sbin/shutdown -P now"
HOSTSYNC 15

/etc/nut/upssched.conf

CMDSCRIPT   "/usr/bin/sudo /usr/local/bin/custom-upssched-cmd"
PIPEFN      /var/run/nut/private/upssched.pipe
LOCKFN      /var/run/nut/private/upssched.lock

AT NOCOMM   * EXECUTE NOTIFY-NOCOMM
AT COMMBAD  * START-TIMER NOTIFY-COMMBAD 10
AT COMMOK   * CANCEL-TIMER NOTIFY-COMMBAD COMMOK
AT FSD      * EXECUTE NOTIFY-FSD
AT LOWBATT  * EXECUTE NOTIFY-LOWBATT
AT ONBATT   * EXECUTE NOTIFY-ONBATT
AT ONLINE   * EXECUTE NOTIFY-ONLINE
AT REPLBATT * EXECUTE NOTIFY-REPLBATT
AT SHUTDOWN * EXECUTE NOTIFY-SHUTDOWN
AT ONBATT   * START-TIMER SHUTDOWN 30
AT ONLINE   * CANCEL-TIMER SHUTDOWN