Αrchive: Testing USB HID NUT UPS Power Off - VincentSaelzler/HomeLab GitHub Wiki
Archive Notice
This page is just a general guide, and doesn't directly relate to the source files of the project.
Background
In an ideal world, a power outage would cause all servers to shut down, followed by having the UPS itself turn off.
That can be easier said than done, especially with USB HID based connections.
The goal of these steps is to test what actually happens.
Hardware
Using a rack-mount APC Smart-UPS 1500 RM. Manufacture date is October 2006. It's connected to the server using a USB cable.
Testing
Check what will happen, without actually doing it.
upsdrvctl -t shutdown
Network UPS Tools - UPS driver controller 2.7.4
*** Testing mode: not calling exec/kill
0.000000
If you're not a NUT core developer, chances are that you're told to enable debugging
to see why a driver isn't working for you. We're sorry for the confusion, but this is
the 'upsdrvctl' wrapper, not the driver you're interested in.
Below you'll find one or more lines starting with 'exec:' followed by an absolute
path to the driver binary and some command line option. This is what the driver
starts and you need to copy and paste that line and append the debug flags to that
line (less the 'exec:' prefix).
0.000080 Shutdown UPS: old-smart-1500
0.000090 exec: /lib/nut/usbhid-ups -a old-smart-1500 -k
Power plugged in to wall. Result is positive! A clunk is heard about the time the UPS is expected to shut off.
upsmon -c fsd
power plugged in
after about 20 seconds
computer completes shut off
hear a clunk
UPS unplugged. Result is not what is desired. UPS continues to operate on battery (draining the batteries needlessly)
upsmon -c fsd
on battery
after about 20 seconds
computer completes shut off
nothing happens with UPS
More concise testing. This is the actual command that's supposed to turn the UPS off.
/lib/nut/usbhid-ups -a old-smart-1500 -k
On wall power - hear clunk
on battery - nothing
The apparent result is that the APC UPS does not implement the USB HID specification to the letter. It doesn't actually turn the UPS off.
Possible next step would be to get a serial connection going, or to update the firmware. Ignoring for now, as the only major drawback here is wear and tear on the batteries