Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.rst

avocentpdu

A python module that allows switching outlets on/off on an Avocent PDU (PM3012V, PM3009H, may work with others)

Installation

With Pip:

pip install avocentpdu

Manually:

Just drop the pdu.py file into the same folder as the python file you’re calling it from.

Usage

It’s super easy. First, include the module like so

import pdu

then initialise an instance of the PDU class

import pdu
pdu = pdu.PDU("pdu_username", "pdu_password", "JabelonePDU", "https://192.168.0.1")

and finally make a function call to switch_outlet()

import pdu
with pdu.PDU("pdu_username", "pdu_password", "JabelonePDU", "https://192.168.0.1") as pdu:
    pdu.switch_outlet(1, 1)

Reference

PDU(string [username], string [password], string [protocol:ip])

When you create a new instance you should supply it with the username, password and protocol/IP address of the webserver running on the PDU box.

Example:

pdu = pdu.PDU("jabelone", "1234", "JabelonePDU", "https://192.168.0.99")

switch_outlet(string [outlet_number], boolean [state])

When you toggle an outlet you must specify the outlet number (as written on the PDU) and a state. The state should be either True for on or False for off. It will send the http requests out even if it’s already in the requested state so don’t spam it. Or do. ¯\_(ツ)_/¯

Example:

# Turn outlet 1 off
pdu.switch_outlet(1, 0)
# Turn outlet 13 on
pdu.switch_outlet(13, 1)

About

A python module that allows switching outlets on/off on an Avocent PDU (PM3012V, may work with others)

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.