Citeren Kevin <bakd...@gmail.com>:

[apc1500]
        driver=usbhid-ups
        port=auto
        ondelay=200
        offdelay=1

Yes.

After restarting the driver, and running shutdown.return, the timers are set to
90 and 200. (the values of ups.delay.shutdown and ups.delay.start)

REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:83 START:193
REBOOT:-1 SHUT:83 START:193

Using values of 250 and 1 gives:

delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244

This looks actually pretty promising. It looks like the UPS sets a lower limit to the shutdown timer. I would not be surprised if this is caused by the value that is set in the "UPS.Output.APCShutdownAfterDelay" HID path, which is currently set at "90".

Could you try the attached patch on the nut-2.6.0 sources, compile it again and run the driver again? If all is well, I expect the 'ups.delay.shutdown' to be a modifiable value after that. You could try if setting it to "20" works. If the above is the case, I expect there might be a mapping for the 'ups.delay.start' and 'ups.delay.reboot' as well.

If the variable seems to be modifiable, try to run 'shutdown.return' again while logging as the above.

[...]

Ok, this makes sense now. The Smart-UPS 1000 apparently has some variations on the 'standard'.

Well, it is not the only UPS (nor vendor) that has. These so called vendor specific HID paths are allowed by the PDC standard. The problem is that every vendor can choose what to put in them. So you can't refer to a standard to find the meaning of them. This is not a problem if we have full access to the specifications (like Eaton for instance). But if the vendor is not willing to share them with us (like APC for instance), we need to reverse engineer them. The latter is a long, tedious process, which requires lots of help from owners of these devices.

[...]

Isn't putting the UPS to sleep the desired behaviour here, so that it wakes up again when power returns?

It should wakeup if the power returns after a power outage. But if the power happens to return between the moment NUT sees the battery is low (and initiates the shutdown sequence on the server) and the moment it sends the shutdown signal to the UPS, it should rather cycle the outlet to prevent what is known as a power race (see the documentation for more information). You don't want to see the happening when you're not around to restart your servers by hand.

[...]

On the CS 500, the shutdown timer is the only one that changes at all. The
reboot and start timers stay at zero (not -1) all the time.

I guess this means that the existing mapping might be wrong. I suspect that it only has 'shutdown.reboot' and that the other mappings allow setting the delay values. Note that in the CS 500 these are all vendor specific HID paths. I'll deal with that, after we fully understand the operation on the Smart-UPS 1000.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)
Index: drivers/apc-hid.c
===================================================================
--- drivers/apc-hid.c	(revision 2844)
+++ drivers/apc-hid.c	(working copy)
@@ -259,6 +259,7 @@
   { "ups.timer.reboot", 0, 0, "UPS.PowerSummary.DelayBeforeReboot", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL},
   /* used by APC SmartUPS RM */
   { "ups.delay.start", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Output.DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_FLAG_ABSENT, NULL},
+  { "ups.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Output.APCShutdownAfterDelay", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL },
   { "ups.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Output.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_FLAG_ABSENT, NULL},
   { "ups.timer.start", 0, 0, "UPS.Output.DelayBeforeStartup", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL},
   { "ups.timer.shutdown", 0, 0, "UPS.Output.DelayBeforeShutdown", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL},
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to