Skip to content

waggle-sensor/padm-pdu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Power Distribution Unit (PDU) Controller

This repository holds useful scripts to control Tripplite PDUs over serial, ssh, and web APIs.

Serial Control Script

Prerequisites

pip install pyserial

Setup

Set the required environment variables:

export PDU_USER=your_username
export PDU_PWD=your_password

Usage

The pductl-serial.py script reads commands from stdin and executes them sequentially on the PDU.

Basic Usage

python3 pductl-serial.py < commands/powercycle_load1

Command Line Options

python3 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)

Examples

Using default settings:

python3 pductl-serial.py < commands/powercycle_load1

Override serial device:

python3 pductl-serial.py -d /dev/ttyUSB1 < commands/powercycle_load1

Override baud rate:

python3 pductl-serial.py -b 9600 < commands/powercycle_load1

Specify credentials via command line (not recommended for security):

python3 pductl-serial.py -u admin -p password < commands/powercycle_load1

Command File Format

Command 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

Creating Custom Command Files

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages