QNAP/UPS slave can't connect to NUT master

Printers, HDDs, USB/eSATA drives, 3rd-party programs
drachul
New here
Posts: 3
Joined: Sat Dec 08, 2012 1:24 pm
Model: TS-659 Pro

QNAP/UPS slave can't connect to NUT master

Postby drachul » Mon Sep 02, 2013 12:25 am

I seem to be having an issue when trying to use a differently configured UPS slave via NUT.
I took a look at this thread here: viewtopic.php?f=182&t=60166 which seemed to be similar, however I'm still not able to get things to work.

I've modified the /etc/config/ups/upsmon.conf file to use the same monitor configuration as other systems connecting to my upsd on my central server:

Code: Select all

MONITOR UPS@192.168.0.2 1 monuser pass slave
but it doesn't seem to be working.
If I look at the logs of the upsd I see this:

Code: Select all

Sep  1 08:32:45 thor upsd[5675]: Connect from 192.168.0.7
Sep  1 08:32:45 thor upsd[5675]: mainloop: polling 7 filedescriptors
Sep  1 08:32:45 thor upsd[5675]: write: [destfd=9] [len=26] [ERR FEATURE-NOT-SUPPORTED]
Sep  1 08:32:45 thor upsd[5675]: mainloop: polling 7 filedescriptors
Sep  1 08:32:45 thor upsd[5675]: write: [destfd=9] [len=16] [ERR UNKNOWN-UPS]
Sep  1 08:32:45 thor upsd[5675]: mainloop: polling 7 filedescriptors
Sep  1 08:32:45 thor upsd[5675]: write: [destfd=9] [len=11] [OK Goodbye]
Sep  1 08:32:45 thor upsd[5675]: Disconnect from 192.168.0.7


(192.168.0.7 is the IP of the QNAP that I'm trying to configure to make use of this)

One thing I do notice though, is upsmon isn't running on the QNAP server, and interestingly if I run upsmon manually on the QNAP, it seems to connect fine:

Code: Select all

Sep  1 09:21:53 thor upsd[6277]: Connect from 192.168.0.7
Sep  1 09:21:53 thor upsd[6277]: mainloop: polling 7 filedescriptors
Sep  1 09:21:53 thor upsd[6277]: write: [destfd=10] [len=26] [ERR FEATURE-NOT-SUPPORTED]
Sep  1 09:21:53 thor upsd[6277]: mainloop: polling 7 filedescriptors
Sep  1 09:21:53 thor upsd[6277]: write: [destfd=10] [len=3] [OK]
Sep  1 09:21:53 thor upsd[6277]: mainloop: polling 7 filedescriptors
Sep  1 09:21:53 thor upsd[6277]: write: [destfd=10] [len=3] [OK]
Sep  1 09:21:53 thor upsd[6277]: mainloop: polling 7 filedescriptors
Sep  1 09:21:53 thor upsd[6277]: User monuser@192.168.0.7 logged into UPS [UPS]


Does anyone have any idea of what might be going on here?

Cheers,
Derek.

fantomas
Experience counts
Posts: 1542
Joined: Mon Feb 07, 2011 5:40 am
Model: TS-419P+
Location: Bratislava, Slovakia
Contact:

Re: QNAP/UPS slave can't connect to NUT master

Postby fantomas » Mon Sep 09, 2013 7:26 pm

drachul wrote:I seem to be having an issue when trying to use a differently configured UPS slave via NUT.
I took a look at this thread here: viewtopic.php?f=182&t=60166 which seemed to be similar, however I'm still not able to get things to work.

I've modified the /etc/config/ups/upsmon.conf file to use the same monitor configuration as other systems connecting to my upsd on my central server:

Code: Select all

MONITOR UPS@192.168.0.2 1 monuser pass slave
but it doesn't seem to be working.


as I have mentioned in the article you are referring to, the UPS must be named QNAPUPS. Try renaming it and check if it works.
experience with administration of UN*X (mostly linux) and applications on internet servers since 1994...

drachul
New here
Posts: 3
Joined: Sat Dec 08, 2012 1:24 pm
Model: TS-659 Pro

Re: QNAP/UPS slave can't connect to NUT master

Postby drachul » Thu Sep 12, 2013 7:09 am

Thanks for the help, it seems that the QNAPUPS UPS name *is* required, regardless of the upsmon.conf setting.

It doesn't even seem to use upsmon, but uses a different tool called upsutil (not sure if this is related to upsmon, some other posts I found seem to indicate it may be derivative.)

This is going to put a wrinkle in my setup, as I have several devices all dependent on this UPS and I can't have both the 'default' UPS configuration (which some of my devices use) along with the QNAP specific one, so I'll have to figure out how to either get upsmon to run on the QNAP, or find out a way to configure the other devices to use a non-default upsmon configuration.

Either way, thanks again for the help.

drachul
New here
Posts: 3
Joined: Sat Dec 08, 2012 1:24 pm
Model: TS-659 Pro

Re: QNAP/UPS slave can't connect to NUT master

Postby drachul » Wed Sep 18, 2013 5:32 am

So after some digging I found a (partial) solution to my problem.

Since I have multiple devices requiring specific ups names/logins, basically I needed to create multiple definitions to account for this in the master NUT server configuration.

In the ups.conf file, thankfully there's a repeater that can be used in place of one physical UPS connection. My configuration is as such:

Code: Select all

[ups]
        driver = apcsmart
        port = /dev/ttyS0
        desc = "APC UPS"

[qnapups]
        driver = dummy-ups
        port = ups@localhost
        desc = "APC UPS for QNAP"


This basically says that the 'qnapups' device is a dummy/repeater for the 'ups' one which is the actual UPS driver instance.
One catch here is, when you start up upsdrvctl (either manually, or via startup scripts on your platform) generally the qnapups driver loading will fail. After consulting the nut-upsuser mailing list, it would appear that this is a bug/limitation of the util, however there's a workaround of manually bringing up the qnapups instance (or another one if the qnapups is defined as the main instance) manually via "upsdrvctl start qnapups" some time after the initial one is loaded.

As for the users, you can just define multiple users as normal, here's what I have:

Code: Select all

[monuser]
        password = pass
        upsmon master

[admin]
        password = 123456
        upsmon master


This will allow you to run basically two separate UPS definitions using the same hardware, hopefully this can prove useful to others. :)

Cheers,
Derek.

User avatar
MrFixit
Easy as a breeze
Posts: 274
Joined: Wed Aug 27, 2008 4:53 pm
Model: TS-509 Pro

Re: QNAP/UPS slave can't connect to NUT master

Postby MrFixit » Sun Nov 24, 2013 2:26 am

An old thread, but I got upsmon to fire up at startup by following this link: http://www.mtom.cz/projects/nutandqnap/

The command

Code: Select all

upsc -c yourups@yourserver
now lists the QNAP's IP as a slave / client to yourups running on yourserver.
NAS: TS-509 Pro (replaced MB)
Firmware: QTS 4.1.1 Build 1101
Drives: 5 x Hitachi 5K3000 2TB drives (RAID 5)
Memory: 4GB
Processor: E7600 (awaiting installation :-))


Return to “Hardware & Software Compatibility”

Who is online

Users browsing this forum: No registered users and 6 guests