Configuring apcupsd on Linux for Multiple USB UPSes

I recently needed to add monitoring of a UPS powering network equipment to a Linux server already monitoring one USB-connected UPS. Since the second UPS also uses a USB connection for monitoring apcpusd (the standard UPS management package for Linux systems) was not seeing it. This is not a fault of the software – it’s designed to work pretty much seamlessly with detection of a single UPS and does so, but autodetectin multiple battery backups would still require some level of manual configuration – at the very least, which one(s) are powering the monitoring system in case it needs to shut down? The solution is to set up udev rules to let the system recognize each attached UPS as a distinct device using the serial number of the UPS, then follow the instructions for managing multiple UPSes in the manual.

Managing multiple UPSes requires multiple instances of apcupsd each running its own configuration. The relevant section of the manual does not mention one key step that’s covered elsewhere in the manual: how to identify each individual UPS. This is covered in the manual in the section on “Device Nodes” which are created in /dev (e.g. /dev/ups0, /dev/ups1) using udev rules. Basically, those rules are run when new devices are plugged into the system and can be used to create specific device entries rather than a default “hiddev” device entry (UPSes are generally seen by the system as Human Interface Devices due to the communications format they use).

Caution: Because each UPS is being identified by serial number, replacing a UPS requires modification of the udev rules on the system in question to match the new serial number. Without that modification the UPS will not be recognized.

[contact-form 2 “Was This Useful”]