feat(powerman): manage Cyclades PM10i PDU via powerman on pfv-tsys1
Set up centralized PDU management for a Cyclades AlterPath PM10i (10
controllable AC outlets) connected to pfv-tsys1 via a Prolific USB-to-DB9
serial adapter. powermand is now listening on 0.0.0.0:10101, making the
PDU manageable over the network from any host on the tailnet.
Scripts (powerman/):
- discover.sh: gather USB adapter, powerman state, device definitions
- setup.sh: idempotent setup — udev rule (stable symlink by serial number),
powerman.conf with 10 outlet nodes, fix powermand dialout group, restart
service. Overridable via env vars for other hosts/PDU types
- test-pdu.sh: validate control by cycling outlet 10 off then on (8/8 pass)
- status.sh: quick PDU status check
Issues fixed during setup:
- Config pointed at /dev/ttyUSB0 but adapter is at /dev/ttyUSB1 (fixed
with udev symlink /dev/cyclades-pm10 pinned to adapter serial)
- powermand (user:powerman) lacked dialout group membership to open the
serial device (fixed with usermod + udev GROUP="dialout")
Validation: outlet 10 turned off (confirmed), turned on (confirmed), then
cycled. All 10 outlets currently ON and manageable.
TODO tracked for Friday: rename outlets from generic (outlet-1..10) to
match physical devices, and change PDU admin password from factory default.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/bash
|
||||
#
|
||||
# powerman/status.sh — quick PDU status check
|
||||
#
|
||||
# Usage:
|
||||
# PROX_HOST=pfv-tsys1 bash tests/remote.sh prox-file powerman/status.sh
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
echo "============================================"
|
||||
echo " Cyclades PM10i PDU Status"
|
||||
echo " Host: $(hostname) $(date)"
|
||||
echo "============================================"
|
||||
|
||||
echo ""
|
||||
echo "=== Service ==="
|
||||
systemctl is-active powerman 2>/dev/null && echo "(running)" || echo "(stopped)"
|
||||
|
||||
echo ""
|
||||
echo "=== Device ==="
|
||||
ls -la /dev/cyclades-pm10 2>/dev/null || echo "(no /dev/cyclades-pm10 symlink)"
|
||||
|
||||
echo ""
|
||||
echo "=== Outlets ==="
|
||||
powerman -l 2>&1
|
||||
|
||||
echo ""
|
||||
echo "=== Power Status ==="
|
||||
powerman -q 2>&1
|
||||
|
||||
echo ""
|
||||
echo "=== Temperature ==="
|
||||
powerman -T 2>&1 || echo "(temperature not available)"
|
||||
Reference in New Issue
Block a user