This repository holds useful scripts to control Tripplite PDUs over serial, ssh, and web APIs.
pip install pyserialSet the required environment variables:
export PDU_USER=your_username
export PDU_PWD=your_passwordThe pductl-serial.py script reads commands from stdin and executes them sequentially on the PDU.
python3 pductl-serial.py < commands/powercycle_load1python3 pductl-serial.py [options]
Options:
-h, --help Show help message and exit
-d, --device DEVICE Serial device path (default: /dev/ttyUSB0)
-b, --baud BAUD Baud rate (default: 115200)
-u, --username USERNAME Username (default: from PDU_USER env var)
-p, --password PASSWORD Password (default: from PDU_PWD env var)Using default settings:
python3 pductl-serial.py < commands/powercycle_load1Override serial device:
python3 pductl-serial.py -d /dev/ttyUSB1 < commands/powercycle_load1Override baud rate:
python3 pductl-serial.py -b 9600 < commands/powercycle_load1Specify credentials via command line (not recommended for security):
python3 pductl-serial.py -u admin -p password < commands/powercycle_load1Command files should contain semicolon-separated commands. The full list of commands can be found in the user's guide PowerAlert® Device Manager(PADM) Version 20 Command Line Interface Example:
device; load 1; off force; on force; exit; exit; exit
You can create your own command files in the commands/ directory. Each command should be separated by a semicolon.
Example for powercycling load 2:
echo "device; load 2; off force; on force; exit; exit; exit" > commands/powercycle_load2
python3 pductl-serial.py < commands/powercycle_load2