2

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@localhost
    desc = "Dummy UPS"

But this doesn't work. When I restart nut, I get the following in my syslog, where 192.168.1.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@localhost] failed - Driver not connected
16:09:47 nut-server upsmon[22221]: Communications with UPS ups@localhost lost
16:09:52 nut-server upsd[22217]: User [email protected] logged into UPS [ups]
16:09:52 nut-server upsmon[22221]: Poll UPS [ups@localhost] failed - Driver not connected
16:09:52 nut-server upsmon[22221]: UPS ups@localhost is unavailable
16:09:57 nut-server upsmon[22221]: Poll UPS [ups@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)

Thanks for any help.

Edit: Fixed a typo in my example ups.conf

1 Answer 1

3

The problem stems from a race condition between drivers, dummy-ups starts and attempts to connect to usbhid-ups before usbhid-ups has finished initializing.

As explained on the NUT Users mailing list, in versions of NUT later than 2.7.2, this can be addressed by using the maxretry and/or retrydelay global directives in ups.conf.

For versions of NUT without these options (e.g., 2.6.3 in ubuntu 12.04), the problem can be overcome by manually starting the UPS (as root) with:

upsdrvctl start ups

This can be done automatically on boot by adding the above line to /etc/rc.local.

3
  • Hi @Jon, I have the same issue. Did you find a solution using "maxretry" and "retrydelay"? I
    – Federico
    Nov 29, 2022 at 13:03
  • Hi @Federico, yes, this was my solution but I don't remember any more specific details than posted here. It looks like it was as simple as adding maxretry and/or retrydelay to your ups.conf...?
    – Jon
    Nov 29, 2022 at 17:49
  • Hi @Jon, I tried to increase these two variables but nothing has changed. The only way is to remove the dummy-ups and use only one driver. If I start the driver manually both UPS work perfectly.
    – Federico
    Nov 30, 2022 at 10:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .