Jonathan Gammell
2015-Jan-01 21:57 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
Hi,
I have a NUT client that requires the UPS it monitors to be named
"ups".
The client (a Synology NAS) does not provide a method to change this
configuration. My setup consists of multiple UPSes monitored by a single
master and I'd rather not have 1/4 UPSes named `ups` while the other 3/4
are named something descriptive and helpful for administration.
I think I should be able to use the "dummy-ups" driver in repeater
mode
to create a virtual UPS named "ups" that tracks the status of a real
UPS
named something else (i.e., `eaton1`).
From the documentation, I think my "ups.conf" should look like:
[eaton1]
driver = usbhid-ups
serial = "..."
port = auto
desc = "Eaton PW9130L1500R-XL2U #1"
[eaton2]
driver = usbhid-ups
serial = "..."
port = auto
desc = "Eaton PW9130L1500R-XL2U #2"
#More UPSes...
[ups]
driver = dummy-ups
port = eaton1
desc = "Dummy UPS"
But this doesn't work. When I restart nut, I get the following in my
syslog, where 192.168.42.2 is the IP address of the Synology NAS:
16:09:46 nut-server usbhid-ups[22208]: Startup successful
16:09:46 nut-server usbhid-ups[22210]: Startup successful
[#One for each UPS]
16:09:47 nut-server upsd[22216]: listening on 192.168.1.1 port 3493
16:09:47 nut-server upsd[22216]: listening on localhost port 3493
16:09:47 nut-server upsd[22216]: Can't connect to UPS [ups]
(dummy-ups-ups): No such file or directory
16:09:47 nut-server upsd[22216]: Connected to UPS [eaton1]:
usbhid-ups-eaton1
16:09:47 nut-server upsd[22216]: Connected to UPS [eaton2]:
usbhid-ups-eaton2
16:09:47 nut-server upsd[22217]: Startup successful
16:09:47 nut-server upsmon[22219]: Startup successful
16:09:47 nut-server upsmon[22221]: Poll UPS [ups at localhost] failed
- Driver not connected
16:09:47 nut-server upsmon[22221]: Communications with UPS
ups at localhost lost
16:09:52 nut-server upsd[22217]: User monuser at 192.168.1.2 logged
into UPS [ups]
16:09:52 nut-server upsmon[22221]: Poll UPS [ups at localhost] failed
- Driver not connected
16:09:52 nut-server upsmon[22221]: UPS ups at localhost is unavailable
16:09:57 nut-server upsmon[22221]: Poll UPS [ups at localhost] failed
- Driver not connected
16:10:21 upsmon[22221]: last message repeated 3 times
If I leave the port entry to "dummy-ups" blank, the Synology UPS
connect
fine, but as "dummy-ups" is running in simulation mode, it cannot get
any UPS information, and does not shutdown on power failure.
I am running ubuntu 12.04.5LTS with NUT 2.6.3 (ubuntu package:
2.6.3-1ubuntu1.1).
Maybe I do not properly understand how repeater mode works? If anyone
has any thought, I would appreciate it.
Thanks,
Jon
P.S., I have cross posted this on serverfault here:
http://serverfault.com/questions/655797/nut-ups-dummy-driver-in-repeater-mode-for-synology-nas
Charles Lepple
2015-Jan-02 01:23 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
On Jan 1, 2015, at 4:57 PM, Jonathan Gammell <jon.gammell at utoronto.ca> wrote:> [ups] > driver = dummy-ups > port = eaton1 > desc = "Dummy UPS"There is a typo in the specification of "port =" in the dummy-ups man page, but your configuration file is effectively looking for a simulation file named 'eaton1'. The presence of an "@" character enables repeater mode. If you change this to 'port = eaton1 at localhost', things should work as you described. The lack of syslog messages is indeed a bug. -- Charles Lepple clepple at gmail
Charles Lepple
2015-Jan-02 01:57 UTC
[Nut-upsuser] Problem with ups-dummy driver (repeater mode)
On Jan 1, 2015, at 8:23 PM, Charles Lepple <clepple at gmail.com> wrote:> On Jan 1, 2015, at 4:57 PM, Jonathan Gammell <jon.gammell at utoronto.ca> wrote: > >> [ups] >> driver = dummy-ups >> port = eaton1 >> desc = "Dummy UPS" > > There is a typo in the specification of "port =" in the dummy-ups man page, but your configuration file is effectively looking for a simulation file named 'eaton1'. The presence of an "@" character enables repeater mode. If you change this to 'port = eaton1 at localhost', things should work as you described.I should also mention a pair of options that were introduced in 2.7.2: maxretry and retrydelay. http://www.networkupstools.org/docs/man/ups.conf.html#_global_directives I haven't used dummy-ups in production (I just use the other mode to simulate an UPS) but I suspect there might be a race condition if upsdrvctl starts dummy-ups before both usbhid-ups instances connect to upsd. Not sure if there is a backport of NUT 2.7.2 to 12.04, but it might be worth looking into. Or you could manually add something to rc.local that restarts dummy-ups if it is not running, but usbhid-ups is. -- Charles Lepple clepple at gmail