SOLVED Cannot monitor UPS locally or remotely - upsc gives Error: Connection failure: Connection refused

Milkysunshine

Dabbler
Joined
Mar 1, 2022
Messages
16
TrueNAS-SCALE-22.02.1
APC1500VA connected via usb.

I'm not sure if this happened with the recent update, but I was definitely able to monitor it with nut-cgi using this exact setup even recently. The ups is connected and verified communicating to TrueNAS. I unplugged the power to the UPS and immediately received the email from TrueNAS that it was on battery power.

Here's the output from the truenas shell itself.

root@zion[/etc/nut]# upsc APC1500VA@192.168.69.10:3493 <--- ip of local truenas system
Error: Connection failure: Connection refused
root@zion[/etc/nut]# upsc APC1500VA@localhost
Error: Connection failure: Connection refused
root@zion[/etc/nut]# upsc APC1500VA@127.0.0.1
Error: Connection failure: Connection refused
root@zion[/etc/nut]# upsc tripplite@192.168.9.131 <------ This is a second ups I have on a different system. It works as expected.
Init SSL without certificate database
battery.charge: 100
battery.runtime: 750
battery.type: PbAC
battery.voltage: 26.3
...etc...

upsd.conf:
LISTEN 0.0.0.0 3493
LISTEN ::0 3493

I'm quite stuck... help?
 
Joined
Jun 2, 2019
Messages
591
The following post might help

 

unixland

Dabbler
Joined
May 16, 2022
Messages
16
Changing the ownership is not entirely the solution, imho. When I do that on my system, the service does start running again, but alerting does not work, and reporting stays empty (-nan). I could partly fix this by not changing the ownership of the /etc/nut directory (and contents), but to do a `usermod -a -G ladvd nut` which effectively adds the nut user to the ladvd group. Then stopping and starting the service via the gui. The service keeps working this way, and my alerting is now working correctly. However, I haven't found a solution to get the reporting up and running.
Anyone ?

I am working on a PowerEdge T620 with TrueNas Scale 22.02.1. The UPS is an EATON PRO 1600, so using the standard usb-hid driver.
 

Zain

Contributor
Joined
Mar 18, 2021
Messages
124
Assuming that fix mentioned above will alleviate my issue as shown below? I have to run those commands any time the system is rebooted. I have intermittent power issues lately so this fix would be great!

1654116963495.png
 

crlorentzen

Cadet
Joined
Apr 6, 2020
Messages
9
I followed @unixland suggestion by adding the 'nut' user to 'ladvd' group via Truenas gui.

Credentials->Local Groups
Search for 'ladvd' use the gear icon to enable built-in groups
Click 'ladvd' then select Members
Find 'nut' on the left side and move to the right.

This fixes it so that reboots don't require any action
1654129731387.png
 
Last edited:

jeti

Cadet
Joined
Apr 7, 2022
Messages
9
Thanks Guys! this helped me getting upsc locally working but I can not connect remotely to my nut instance, I always get:
Error: Connection failure: Connection refused
I think my nut server looks ok:
root@truenas[~]# service nut-server status
● nut-server.service - Network UPS Tools - power devices information server
Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-06-06 19:01:47 CEST; 16s ago
Process: 2362251 ExecStart=/sbin/upsd (code=exited, status=0/SUCCESS)
Main PID: 2362252 (upsd)
Tasks: 1 (limit: 37910)
Memory: 740.0K
CGroup: /system.slice/nut-server.service
└─2362252 /lib/nut/upsd

Jun 06 19:01:47 truenas upsd[2362251]: fopen /run/nut/upsd.pid: No such file or directory
Jun 06 19:01:47 truenas upsd[2362251]: listening on ::0 port 3493
Jun 06 19:01:47 truenas upsd[2362251]: listening on ::0 port 3493
Jun 06 19:01:47 truenas upsd[2362251]: not listening on 0.0.0.0 port 3493
Jun 06 19:01:47 truenas upsd[2362251]: not listening on 0.0.0.0 port 3493
Jun 06 19:01:47 truenas upsd[2362251]: Connected to UPS [ups]: usbhid-ups-ups
Jun 06 19:01:47 truenas upsd[2362251]: Connected to UPS [ups]: usbhid-ups-ups
Jun 06 19:01:47 truenas upsd[2362252]: Startup successful
Jun 06 19:01:47 truenas systemd[1]: Started Network UPS Tools - power devices information server.
Jun 06 19:01:54 truenas upsd[2362252]: User ups@::1 logged into UPS [ups]
Is this part of the permissions issue?
Thanks!
 
Top