Skip to main content

A simple package to control PDUs

Project description

pducontrol

pducontrol is a Python library to control a wide variety of PDUs Currently we support the following models:

  • SWH-1023J-08N1 (Dexlan, seems to be just an OEM rebadged unit)
  • PDU81003 (CyberPower)
  • NetIO 4C

Installation

You can install pducontrol from source:

make pip
pip install /dist/pducontrol-*.tar.gz

or just call the refresh_package.sh script

Usage

This package provides both Python and CLI interfaces, here is how you can use them:

In Python

from pducontrol import PDUControlREST
pdu = PDUControlREST("192.168.0.23")
print(pdu.get_all_names())

In CLI

pducontrol 192.168.0.23 get_name all

A configuration file named pdu_settings.cfg, containing IP addresses and credentials can be added in~/.config/pducontrol/ for ease of use and autocompletion.

An example file is available in config.

Contributing

Bug reports and comments are warmly welcome, but contributions, such as pull requests and patches, are not, for legal reasons only. If that's bothering you, don't hesitate to tell, with enough pressure, we could reconsider our position.

License

pducontrol is released under LGPL v3

Hacking

Execute the program from the source directory

python3 -m pducontrol

Generate a debian package

make debian

Execute the unit tests

They are located in tests/.

make test

Coding style

All python files should respect the PEP 8 coding style and shell scripts, the shellcheck coding style.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pducontrol-1.5.1.tar.gz (25.8 kB view details)

Uploaded Source

File details

Details for the file pducontrol-1.5.1.tar.gz.

File metadata

  • Download URL: pducontrol-1.5.1.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pducontrol-1.5.1.tar.gz
Algorithm Hash digest
SHA256 ff92887c3ffbdc6b51a67b36cc5ec65b5a549d0a808d4fcf04ad9f3c35a56111
MD5 1d28981b8befd8e8b76de37913c57dc2
BLAKE2b-256 bca59f4ecc83de0a22ffcade7934fb718cf532d63064d5f66291470131145484

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page