UPS in slave mode and NUT

Printers, HDDs, USB/eSATA drives, 3rd-party programs
Post Reply
dwaynek
Starting out
Posts: 11
Joined: Fri May 06, 2016 2:02 am

UPS in slave mode and NUT

Post by dwaynek »

i couldn't get this to work when attempting to connect my qnap as a ups slave to my synology ups master.

i changed upsmon.conf:

Code: Select all

MONITOR ups@192.168.0.4 1 monuser secret slave
but noticed upsmon isn't even running. when i try to start it up, it dies after a few secs.

i tried:

http://www.mtom.cz/url/Linux/QNAP+a+NUT

but again it dies after reboot.

are there other configuration changes i need to make?
User avatar
OneCD
Guru
Posts: 12156
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: UPS in slave mode and NUT

Post by OneCD »

* topic split from viewtopic.php?f=182&t=60166 *

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage
ewerber
New here
Posts: 6
Joined: Wed Jan 16, 2019 9:37 am

Re: UPS in slave mode and NUT

Post by ewerber »

Hi
I am running an RPI 4 which runs a NUT server with the following settings, should not be terribly difficult for you to adapt this to other platforms if you have SSH access to config files or better yet do like I did and run everything in dockers.

Add the following line to upsmon.conf

Code: Select all

MONITOR qnapups@localhost 0 admin 123456 slave
Add the qnap user to the upsd.users file

Code: Select all

# Used by Qnap QTS to monitor this server
[admin]
	password = 123456
	upsmon slave 
Add the qnap slave "UPS" in the ups.conf file, note it is important to choose the correct driver etc.

Code: Select all

#qnapups allows qnap machines to be slaves to this master
[qnapups]
            driver = %%%the driver appropriate for your UPS%%%
            port = %%%The port needed to connect to the real UPS using the driver you choose%%%
After this you simply go to the Qnap slave UPS settings in QTS, type the IP of the NUT server and everything should work, I have 3 Qnap machines feeding from my RPI and another Grafana slave that saves the UPS statistics.
jack94_85
First post
Posts: 1
Joined: Fri Jan 07, 2022 1:03 am

Re: UPS in slave mode and NUT

Post by jack94_85 »

ewerber wrote: Mon Feb 15, 2021 1:28 am Hi
I am running an RPI 4 which runs a NUT server with the following settings, should not be terribly difficult for you to adapt this to other platforms if you have SSH access to config files or better yet do like I did and run everything in dockers.

Add the following line to upsmon.conf

Code: Select all

MONITOR qnapups@localhost 0 admin 123456 slave
Add the qnap user to the upsd.users file

Code: Select all

# Used by Qnap QTS to monitor this server
[admin]
	password = 123456
	upsmon slave 
Add the qnap slave "UPS" in the ups.conf file, note it is important to choose the correct driver etc.

Code: Select all

#qnapups allows qnap machines to be slaves to this master
[qnapups]
            driver = %%%the driver appropriate for your UPS%%%
            port = %%%The port needed to connect to the real UPS using the driver you choose%%%
After this you simply go to the Qnap slave UPS settings in QTS, type the IP of the NUT server and everything should work, I have 3 Qnap machines feeding from my RPI and another Grafana slave that saves the UPS statistics.
Hi,

I have been trying to get this working and it's driving me mad! I have an RPI 3B+ which runs the nut server and applied the config you mention here and everything looks to be good and connected but within 12 hours the data stale alerts with my UPS... as soon as I remove the config it's solid... what am I missing!?

ups.conf

Code: Select all

maxretry = 3

[CyberPower]
    driver = usbhid-ups
    port = auto
    desc = "CyberPower CP1500EPFCLCDUK"
    vendorid = 0764
    productid = 0501
    serial = XXXXXXXXXXXX
    vendor = CPS
    product = CP1500EPFCLCD
    pollinterval = 15

#qnapups allows qnap machines to be slaves to this master
[qnapups]
            driver = usbhid-ups
            port = auto
upsmon.conf

Code: Select all

MONITOR CyberPower@localhost 1 upsmon_master <password> master
MONITOR qnapups@localhost 0 admin 123456 slave

DEADTIME 25
upsd.users

Code: Select all

[administrator]
    password = <password>
    actions = SET
    instcmds = ALL

[upsmon_master]
    password = <password>
    upsmon master

[upsmon_slave]
    password = <password>
    upsmon slave

[admin]
    password = 123456
    upsmon slave

[testuser]
    password  = <password>
    instcmds  = test.battery.start.quick
    instcmds  = test.battery.stop
    instcmds  = test.battery.start.deep
upsd.conf

Code: Select all

MAXAGE 25
Would really appreciate any help... thanks in advance!
ewerber
New here
Posts: 6
Joined: Wed Jan 16, 2019 9:37 am

Re: UPS in slave mode and NUT

Post by ewerber »

I see you have two UPS's in your ups.conf file, the [qnapups] and [CyberPower], in the minimum I would figure that the qnapups section parameters should be identical to the CyberPower section if NUT even supports duplicating UPS's for configuration's sake.
I don't understand why you have two sections? do you have two UPS's connected? if not I would ditch the CyberPower section and move its contents over to the qnapups section.
Just make sure you have the proper admin with 123456 password in the upsd.users file and it should work.
rogclifford
New here
Posts: 9
Joined: Thu Nov 07, 2019 9:18 am

Re: UPS in slave mode and NUT

Post by rogclifford »

I know this is an old thread but I am at my wits end trying to get my TS453A connected as a slave to an RPi 3B. I have two server the QNAP and a Synology. The Synology connects fine but whatever I enter the QNap refuses to talk to the RPi. I followed the details mentioned in the thread to the letter but I get "Poll UPS [qnapups@localhost] failed [qnapups]does not exist on server localhost" when I run service nut-client status.
I am a novice at this so hopefully someone can point me to what I am doing wrong
In upsmon.conf i have:
MONITOR qnapups@localhost 0 admin 123456 slave
In upsd.users I have added
[admin]
password = 123456
upsmon slave
and in ups .conf I have added:
[qnapups]
driver = usbhid-ups
port = auto

What am I missing ? Help much appreciated.
User avatar
dolbyman
Guru
Posts: 35275
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: UPS in slave mode and NUT

Post by dolbyman »

why localhost?

if the server is on a raspi, it wont be NAS local, also the username is probably not qnapups for the pi

to make your life easy, just setup the raspi server with the default qnap user and password, then you can add the qnap as slave via the regular UPS slave gui
rogclifford
New here
Posts: 9
Joined: Thu Nov 07, 2019 9:18 am

Re: UPS in slave mode and NUT

Post by rogclifford »

Thanks for the reply. Im even more confused. I tried changing the upsmon.conf to qnapups@ (Qnap IP) 0 admin 123456 slave. The QNAP can see the RPi and lists the UPS in its GUI but the connection to the Synology NAS is now lost. What text do I need to enter and where for this to work with both slaves. I've read up losts of posts but nowhere can I find one with two slaves (QNAP and Synology) to an RPi master. Somewhere I read the QNAp requires qnapups and password =123456 but where do I enter that ? In upsd.users (which is where I have added it ) or somewhere else.
Would really appreciate a walkthrough on this if someone can help.
User avatar
dolbyman
Guru
Posts: 35275
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: UPS in slave mode and NUT

Post by dolbyman »

If the NUT server is on the PI...it needs to be the PI IP in that config.

Username and password are that of the PI server aswell. If you already have a Syno as slave..how did you set that one up?
rogclifford
New here
Posts: 9
Joined: Thu Nov 07, 2019 9:18 am

Re: UPS in slave mode and NUT

Post by rogclifford »

dolbyman wrote: Sun Nov 13, 2022 11:11 pm If the NUT server is on the PI...it needs to be the PI IP in that config.

Username and password are that of the PI server aswell. If you already have a Syno as slave..how did you set that one up?
Thanks again.For the Synology all I did was enter this in uspd.users
[monuser]
password =secret
uspsmon =slave
and it worked!
rogclifford
New here
Posts: 9
Joined: Thu Nov 07, 2019 9:18 am

Re: UPS in slave mode and NUT

Post by rogclifford »

So to be clear this setup is now:
MONITOR ups@localhost 1 upsmon secret master
In upsd.users I have
[admin]
password = secret
upsmon master

[upsmon_master]
password = secret
upsmon master

[upsmon_slave]
password =secret
upsmon slave

[monuser]
password =secret
upsmon slave

[qnapups]
password=123456
upsmon slave

ups .conf I have added:
[ups]
driver = usbhid-ups
port = auto

Does this look right?
User avatar
dolbyman
Guru
Posts: 35275
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: UPS in slave mode and NUT

Post by dolbyman »

I still see nowhere the IP or hostname of that raspi
FSC830
Experience counts
Posts: 2043
Joined: Thu Mar 03, 2016 1:11 am

Re: UPS in slave mode and NUT

Post by FSC830 »

dolbyman wrote: Mon Nov 14, 2022 2:32 am I still see nowhere the IP or hostname of that raspi
I guess you are mistaken. :wink:
The NUT service runs at the raspberry Pi, so @localhost should be correct.
Comparing to my firewall appliance, which runs the NUT service, the entries for a QNAP are as follows:

Code: Select all

qnapups@localhost
[qnapups]
password=123456
upsmon slave
At QNAP the checkbox for "Network UPS Slave" is checked and IP Address of UPS server is the firewall.

Regards
Last edited by FSC830 on Tue Nov 15, 2022 12:00 am, edited 1 time in total.
User avatar
dolbyman
Guru
Posts: 35275
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: UPS in slave mode and NUT

Post by dolbyman »

I thought op was posting the NAS config all the time ..hence that it makes no sense that it is localhost (raspi wont be localhost)

I already said that QNAP GUI can be used if QNAP default user and password are used on the raspi :wink:

viewtopic.php?f=182&t=159585&p=832144#p832037
Post Reply

Return to “Hardware & Software Compatibility”