Open source 2021

APC Switched Rack PDU Control Panel

A web panel in a single PHP file that controls several APC Switched Rack PDUs over SNMPv3: switch, reboot and rename single outlets or whole PDUs, in the browser or by HTTP call from shortcuts and home automation.

Since

2021

Licence

MIT

Panel with two PDUs
1
PHP file for the whole panel
3
SNMPv3 security levels to pick
3
actions per outlet: on, off, reboot
0
databases needed

Technologies

PHP php-snmp SNMPv3 APC PowerNet MIB Bootstrap clipboard.js Subresource Integrity

The Challenge

APC Switched Rack PDUs come with their own web interface, but one per PDU. Anyone running several PDUs in a rack or on the wall clicks through several interfaces just to switch an outlet or hard-reboot a server.

The Solution

A lean panel brings all PDUs together on one page. It talks to the PDUs directly over SNMPv3 using APC's PowerNet OIDs and shows each PDU's outlets with name and status. It is installed by uploading a single PHP file and listing the PDUs at the top of that file.

What the panel does

Switch outlets

Switch each outlet on or off or reboot it, with name and status (on, off, unknown) per outlet.

Whole PDUs

Switch all outlets of a PDU on, off or reboot them at once and rename the PDU; new names are checked for printable ASCII.

Clear error messages

Dedicated messages for timeout, invalid address, non-ASCII names and the case that all PDUs are disabled.

SNMPv3 instead of the web UI

The panel switches through PHP SNMP with SNMPv3 and APC's PowerNet OIDs. Per PDU you set whether it is active, plus address, user, passphrases, protocols and the security level: noAuthNoPriv, authNoPriv or authPriv with authentication and encryption. According to the README it was tested with the AP7920, AP7921 and AP7920B models, with more reported by contributors.

As an API for home automation

Every action of the panel is a plain HTTP call with the PDU's address and the outlet number. For a single outlet the panel reads the current state over SNMPv3 and toggles it; whole PDUs can be switched on, off or rebooted on purpose. In everyday use an NFC tag on the phone triggers a shortcut that switches selected outlets on or off depending on their current state.

Use and licence

The panel is meant for internal use and needs only PHP with the SNMP extension, no database. The interface uses Bootstrap with a light and a dark design. The code is on GitHub under the MIT licence.

Results

A small tool that solves an everyday rack problem: switch several PDUs on one page, with a single PHP file as the whole installation, and the same actions as HTTP calls for shortcuts and home automation.

Gallery

Images from the project's GitHub repository.