Freenas UPS server not functioning

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
So my Googling has come up dry. I have an APC Back-UPS Pro 900 connected to my FreeNAS 11.3 U1 machine via USB and the UPS service enabled. Everything works fine and dandy, upsc APC@localhost in the terminal throws back all the needed data, the server gets shutdown when the UPS runs out of battery, I get reports, etc.

I also set the Monitor User and password fields with the intention of starting a server for two additional computer, connected to the UPS - a Windows box and a Raspberry.Pi. After being unsuccessful with the Windows box, I now tried the NUT service on the RPi as well and I get the same error, "connect failed: Connection failure: Connection refused". This makes it two against one and it's not a Windows thing anymore.

Apparently I'm doing something wrong and by looking at any guides, I can't seem to find the issue. Adding a 'LISTEN [freenas IP]' line to the ups.conf field produces 'Connection failure: Connection refused' errors in the status console.

I know I haven't provided much information, but I'm not really sure what specifics I should add, so I'll be happy to answer any questions.
 
Joined
Jan 4, 2014
Messages
1,644
starting a server for two additional computer, connected to the UPS
Looking at the UPS specs, I understand there is only one USB port. How exactly are you connecting the two additional computers?
 
Joined
Jan 7, 2015
Messages
1,155
The way mine is set between pfSense and FreeNAS is a few very simple settings. Your FreeNAS should be set as MASTER, the IDENTIFIER, correct driver etc. REMOTE MONITOR (mine has default creds upsmon fixmepass), the rest of the settings you can set how you choose.

Then on the SLAVE MACHINE(S) all you need is IDENTIFIER@FREENAS.IP Login:upsmon Pass:fixmepass (if you changed these use appropriate creds). That really should be about it.
 

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
Looking at the UPS specs, I understand there is only one USB port. How exactly are you connecting the two additional computers?
The two computers are (or will, RPi is not yet) powered off the UPS, therefore 'connected'. Sorry for the misunderstanding. There is no USB connection to the two machines, that's why I'm trying to run the server on Freenas to get the signal to shut down the two additional machines.

The way mine is set between pfSense and FreeNAS is a few very simple settings. Your FreeNAS should be set as MASTER, the IDENTIFIER, correct driver etc. REMOTE MONITOR (mine has default creds upsmon fixmepass), the rest of the settings you can set how you choose.

Then on the SLAVE MACHINE(S) all you need is IDENTIFIER@FREENAS.IP Login:upsmon Pass:fixmepass (if you changed these use appropriate creds). That really should be about it.
I've done exactly that. No dice. The driver appears to be correct considering the Freenas machine talks with the UPS. The identifier, IP and login information is also correct on both machines. And I get the same error on both machines.
 
Joined
Jan 4, 2014
Messages
1,644
After being unsuccessful with the Windows box
Is the software you're using on the Windows box capable of acting as a NUT client?
 
Joined
Jan 7, 2015
Messages
1,155
See if nut is listening on 3493 in the freenas host sockstat -4 -l | grep 3493
 

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
Is the software you're using on the Windows box capable of acting as a NUT client?
I've tried the https://networkupstools.org/ Windows client (had problems running it as a service, it turned off immediately) and then i found the WinNUT client (the service version, not the monitoring version from Sourceforge), where the service is working and I got the same errors as on Linux. For Linux (raspbian) I used apt to install 'nut-client'.


See if nut is listening on 3493 in the freenas host sockstat -4 -l | grep 3493
root@freenas:~ # sockstat -4 -l | grep 3493
uucp upsd 62187 5 tcp4 127.0.0.1:3493 *:*


BTW, i've removed the 'LISTEN [freenas IP]' line from ups.conf field, it was throwing me errors (e-mail reporting of them as well). All is 'fine' now without it.
 
Joined
Jan 4, 2014
Messages
1,644

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
I set both the Windows machine and the RPi as NUT slaves. And on both i get, if i quote myself...
I get the same error, "connect failed: Connection failure: Connection refused". This makes it two against one and it's not a Windows thing anymore.
I guess it wasn't clear enough that both machines were running NUT in slave mode, but I thought it's clearly implied when I said I set Freenas up as a server (i.e. master, broadcasting status and commands to slaves).
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Try connecting over the network but from the freenas box. You know freenas can make a local connection so the clients working, if you connect using the ip via freenas you can test the server.
 

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
Try connecting over the network but from the freenas box. You know freenas can make a local connection so the clients working, if you connect using the IP via freenas you can test the server.
So in a terminal write upsc ID@IP ? Error: Connection failure: Connection refused.

Changing the IP for 'localhost' throws out tons of data, as expected.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
So in a terminal write upsc ID@IP ? Error: Connection failure: Connection refused.

Changing the IP for 'localhost' throws out tons of data, as expected.
try upsc -l <hostname/ip> does this list your ups?
but yeah upsc id@IP should work.

double check you checked the remote monitor button? Maybe share a screenshot of your ups config page.
 

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
try upsc -l <hostname/IP> does this list your ups?
but yeah upsc id@IP should work.

double check you checked the remote monitor button? Maybe share a screenshot of your ups config page.
'APC' (correct) when I use localhost, connection refused when I use the IP.

I did not have it checked, checking it solved it apparently.

I checked the documentation and checked the help on the checkbox on the server itself and don't really see a reason why this would have the desired effect given the help field explanation. I also did a Google search on the topic and basically found no hits. Am I the only one that missed the option and didn't see the point of it reading the explanation?

Anyway, thanks for the help for now, I'll test the functionality of the system soon (forced shutdown command on the master to see if salves shut down too), but the communication on both slaves now shows promising results.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
'APC' (correct) when I use localhost, connection refused when I use the IP.

I did not have it checked, checking it solved it apparently.

I checked the documentation and checked the help on the checkbox on the server itself and don't really see a reason why this would have the desired effect given the help field explanation. I also did a Google search on the topic and basically found no hits. Am I the only one that missed the option and didn't see the point of it reading the explanation?

Anyway, thanks for the help for now, I'll test the functionality of the system soon (forced shutdown command on the master to see if salves shut down too), but the communication on both slaves now shows promising results.
That box just makes it so external services can connect.
 

Primož

Dabbler
Joined
Feb 5, 2015
Messages
29
I understand that now. But that's what i'm trying to say, the Help on the checkbox doesn't really explain that (at least not clearly...), chapter 13.15.1 of the user guide doesn't cover anything really (https://www.ixsystems.com/documenta...services.html#multiple-computers-with-one-ups) and none of the forum/web guides state that it should be checked. That's my gripe, it was a simple checkbox (once i had issues with two separate systems and after I saw it's the same accessing the UPS via the IP on the master system I figured it will be something like that), but nothing really makes it clear what it does. For all intents and purposes it could be a box with 'checkbox' written next to it, at least the way i see it...
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I understand that now. But that's what i'm trying to say, the Help on the checkbox doesn't really explain that (at least not clearly...), chapter 13.15.1 of the user guide doesn't cover anything really (https://www.ixsystems.com/documenta...services.html#multiple-computers-with-one-ups) and none of the forum/web guides state that it should be checked. That's my gripe, it was a simple checkbox (once i had issues with two separate systems and after I saw it's the same accessing the UPS via the IP on the master system I figured it will be something like that), but nothing really makes it clear what it does. For all intents and purposes it could be a box with 'checkbox' written next to it, at least the way i see it...
It's pretty clear to me. Maybe you can care a better tool tip and submit it as a bug.
 
Top