QNAP as UPS slave to another NUT Server

Printers, HDDs, USB/eSATA drives, 3rd-party programs
theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

Hello. I have setup a NUT server on another machine and I want my QNAP NAS to shutdown when I lose power. The web UI lets me enter an IP address, but not configure a username or password which I need to be able to do to integrate my QNAP with my NUT Server.

Using ssh I tried accessing

Code: Select all

/etc/config/ups
. I updated upsd.users and upsmon.conf with credentials I created to access my NUT server, which I call tripplite. If I call upsc tripplite I successfully see data come through about the UPS status. Great! The problem is that this still doesn't show up in the UI. I tried restarting the NAS thinking that I just needed to restart the nut client service (and I wasn't sure how to do that, why not reboot the whole thing) but no change - the "UPS Information" in the UI still does not list AC Power status, battery capacity, anything. So I'm betting the QNAP isn't actually monitoring this.

Do I also need to make changes to ups.conf and upsd.conf? Or, does QNAP not allow use of custom users, and instead I have to add a user to my NUT server?

I feel like I'm missing something easy that should be straightforward...
User avatar
moody_blue
Easy as a breeze
Posts: 266
Joined: Tue Jan 10, 2017 9:23 am

Re: QNAP as UPS slave to another NUT Server

Post by moody_blue »

Some help in viewtopic.php?f=182&t=161060#p794298 (and also on other posts on this thread)
QNAP TS-253A 8G QTS 5.0.1.2145
Plex Media Server 1.29.0.6209
OpenHAB 3.4.0.M2
Unifi 7.2.92
Apache80 2454.8230
GLPI 10.0.3
User avatar
dolbyman
Guru
Posts: 35246
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: QNAP as UPS slave to another NUT Server

Post by dolbyman »

theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

Re: QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

Thank you both for the quick replies. I had seen the threads both dolbyman and moody_blue had posted (I also was confused for a while whether some of the config was on an RPi or the QNAP...) There's some particular lines that are concerning.
graemev wrote:So I'll make a cry for help to @OneCD. The file /etc/config/ups/upsmon.conf has
hardwired values that really pessimises security. The RO copy will be elsewhere,
but it needs updating here in this RW copy after it's restored but before it's
used.

Until that's resolved, we have to live with what we have. We will need to make
the config/credentials match the ones supplied from the Qnap (rather back to
front).

...

But as we can see from the above config on Qnap, the UPSname MUST be defined as
qnapups and not BX700 as I'd prefer. So we need to edit as follows:
This is a problem. I have an existing NUT Server, and existing NUT clients. My NAS shouldn't dictate what the UPS name is, and shouldn't dictate the credentials for the admin account.

It looks like jack94_85 tries to get around this and tries to duplicate the source UPS so QNAP can see it, doesn't seem to work.


So I guess the question is, is there a known way to get the QNAP NAS to act as a NUT client WITHOUT using its default QNAP credentials? At least in the CLI using uspc the software clearly can. I assume that somewhere (whether it's in config, or default_config, or elsewhere) there should be a way to tell the QNAP to use non-default creds. I feel like that's what I have setup by editing /etc/config/ups/upsmon.conf but that doesn't seem to be the case.
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP as UPS slave to another NUT Server

Post by OneCD »

theTrebleClef wrote: Sun Jan 29, 2023 9:12 am
graemev wrote:So I'll make a cry for help to @OneCD. The file /etc/config/ups/upsmon.conf has ...
Oops, I must have missed this. :'

May I ask: is the problem the hardwired credentials and UPS name assigned by QTS? You'd like to be able to change these?

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

Re: QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

OneCD wrote: Sun Jan 29, 2023 9:19 am
theTrebleClef wrote: Sun Jan 29, 2023 9:12 am
graemev wrote:So I'll make a cry for help to @OneCD. The file /etc/config/ups/upsmon.conf has ...
Oops, I must have missed this. :'

May I ask: is the problem the hardwired credentials and UPS name assigned by QTS? You'd like to be able to change these?
I actually quoted from another thread where someone tagged you, ha. But yes, that is what I would like to do.

In my case, I have a dedicated VM I use as a NUT server. It has custom credentials and I have several NUT clients including virtualization hosts. I want to add my QNAP NAS as a NUT client so that it can auto-shut down appropriately. Simply typing the IP address of the NUT server into the QNAP UI does not work - it appears that QNAP defaults to the assumption that the NUT server uses the QNAP's UPS name and credentials (which I do not do). I am seeking the appropriate way to change the UPS client monitoring configuration on my NAS so that it can connect to my NUT server.

My UPS name on the NUT server is "tripplite." On the QNAP I have updated /etc/config/ups/upsmon.conf with appropriate credentials. If on the QNAP I run upsc tripplite@NUTSERVERIP it will correctly show the server data. But that data still does not appear in the QNAP UI and I do not know (apart from unplugging the UPS) if it is correctly monitoring the server.
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP as UPS slave to another NUT Server

Post by OneCD »

theTrebleClef wrote: Sun Jan 29, 2023 10:09 am My UPS name on the NUT server is "tripplite." On the QNAP I have updated /etc/config/ups/upsmon.conf with appropriate credentials. If on the QNAP I run upsc tripplite@NUTSERVERIP it will correctly show the server data. But that data still does not appear in the QNAP UI and I do not know (apart from unplugging the UPS) if it is correctly monitoring the server.
Did you also update the /etc/config/ups/upsd.users file with these credentials?

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

Re: QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

OneCD wrote: Sun Jan 29, 2023 10:33 am Did you also update the /etc/config/ups/upsd.users file with these credentials?
Yes, although I may not have done it properly.

Code: Select all

[username]
                password = "PWD"
                allowfrom = localhost
                actions = SET
                instcmds = ALL
                upsmon slave
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP as UPS slave to another NUT Server

Post by OneCD »

I have a feeling the 'allowfrom' key should be the IP address/hostname of your NUT master.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

Re: QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

OneCD wrote: Sun Jan 29, 2023 10:59 am I have a feeling the 'allowfrom' key should be the IP address/hostname of your NUT master.
I just made that change. I closed the UI and re-opened it - no UPS stats showing up there still. Maybe I need to restart the NUT client monitoring service? Do you know how to restart the UPS service without restarting the whole NAS?
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP as UPS slave to another NUT Server

Post by OneCD »

theTrebleClef wrote: Sun Jan 29, 2023 11:18 am I just made that change. I closed the UI and re-opened it - no UPS stats showing up there still. Maybe I need to restart the NUT client monitoring service?
I don't know, I haven't done this myself.
theTrebleClef wrote: Sun Jan 29, 2023 11:18 am Do you know how to restart the UPS service without restarting the whole NAS?
Yes, you can call the UPS init script for this:

Code: Select all

/etc/init.d/ups.sh restart

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
theTrebleClef
Starting out
Posts: 19
Joined: Wed Jun 10, 2015 12:05 pm

Re: QNAP as UPS slave to another NUT Server

Post by theTrebleClef »

OneCD wrote: Sun Jan 29, 2023 11:21 am Yes, you can call the UPS init script for this:

Code: Select all

/etc/init.d/ups.sh restart
Tried that restart. The UPS still doesn't show up in the UI. My upsd.users is currently:

Code: Select all

[usernameHere]
                password = "secretHere"
                allowfrom = NUTserverIPHere
                actions = SET
                instcmds = ALL
                upsmon slave
User avatar
OneCD
Guru
Posts: 12144
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: QNAP as UPS slave to another NUT Server

Post by OneCD »

Maybe someone who has done this can advise?

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: QNAP as UPS slave to another NUT Server

Post by FSC830 »

Afaik you cant change the hardwired settings in QTS. :(

My NUT server is running too at an external host, the settings are shown in the linked posts, specially here.

Regards
User avatar
moody_blue
Easy as a breeze
Posts: 266
Joined: Tue Jan 10, 2017 9:23 am

Re: QNAP as UPS slave to another NUT Server

Post by moody_blue »

theTrebleClef wrote: Sun Jan 29, 2023 9:12 am This is a problem. I have an existing NUT Server, and existing NUT clients. My NAS shouldn't dictate what the UPS name is, and shouldn't dictate the credentials for the admin account.
I don't consider this to be a security risk. I've never explored NUT extensively but I think that nut clients have restricted priviledges and "harmfull" commands can only be issued by the nut server. It may be a problem if there are other machines imposing their credentials.

Firewalls can probably be used to restrict who can access the nut server if needed.
QNAP TS-253A 8G QTS 5.0.1.2145
Plex Media Server 1.29.0.6209
OpenHAB 3.4.0.M2
Unifi 7.2.92
Apache80 2454.8230
GLPI 10.0.3
Post Reply

Return to “Hardware & Software Compatibility”