Starlyng BCM Connection
A Python library for executing Baseboard Management Controller (BMC) commands on servers using IPMI.
Features
- Execute BMC commands on remote servers using IPMI via
execute_bcm_command - Parallel execution of commands across multiple servers using threading
- Comprehensive error logging and handling
- Support for common IPMI operations:
- Power management (status, on, off, cycle, reset)
- System Event Log (SEL) operations
- Chassis control
- Flexible server configuration through
BCMServerclass - Secure connection handling with IPMI over LAN (LANPLUS)
- Command output capture and structured response handling
- Utility functions for hostname and IP address management:
- Generate consistent host IDs and hostnames
- Handle both local and public IP configurations
- VLAN-aware IP address management
Prerequisites
Before you begin, ensure you have:
- Python 3.9 or higher installed
- ipmitool installed on your system:
- Ubuntu:
sudo apt-get install ipmitool - macOS:
brew install ipmitool
- Ubuntu:
- If outside local network, configure port forwarding on your router:
- Forward BCM port 623 to each server's unique port (62300-62399)
- Example: Forward port 62300 to 192.168.50.1:623, port 62301 to 192.168.50.2:623
- Port range must be between 62300-62399
Installation
pip install starlyng-bcm-connection
Usage
Basic Example
from bcm_connection import BCMServer, execute_bcm_command
# Create a BCM server instance
server = BCMServer(
bcm_ip="192.168.1.1",
bcm_user="admin"
bcm_pass="password"
bcm_port=623
)
# Execute a command
# Pass server in a list since execute_bcm_command expects List[BCMServer]
result = execute_bcm_command([server], "power status")
print(result)
Hostname and IP Management
from bcm_connection import get_hostname, get_host_id, get_ip_for_bcm
# Generate a hostname for a local server
hostname = get_hostname("server", "192.168.1.20", 623, public_ip=False)
# Result: "server10" (20 - 10 = 10)
# Generate a hostname for a public server
hostname = get_hostname("server", "203.0.113.1", 62345, public_ip=True)
# Result: "server45" (last two digits of port)
# Get BCM IP address with VLAN
bcm_ip = get_ip_for_bcm("192.168.1.20", vlan_id=50, public_ip=False)
# Result: "192.168.50.20" (VLAN ID injected)
Available BMC Commands
Common IPMI commands you can execute:
power status- Get power statuspower on- Power on the serverpower off- Power off the serverpower cycle- Power cycle the serverpower reset- Reset the server
Contributing
- Fork the project
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add some YourFeature') - Push to the branch (
git push origin feature/YourFeature) - Open a pull request
Contact
If you have any questions, please contact:
- GitHub: @justinsherwood
Metadata
Release files for starlyng-bcm-connection 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| starlyng_bcm_connection-0.1.4.tar.gz | 5.2 kB | Without provenance | Details for starlyng_bcm_connection-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| starlyng_bcm_connection-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for starlyng_bcm_connection-0.1.4-py3-none-any.whl |
Total release size: 11.0 kB
Release files / starlyng_bcm_connection-0.1.4.tar.gz
| Download URL | starlyng_bcm_connection-0.1.4.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28960acdaed011df13fc5f53cd2b1e16b7a69819e7b98c78044bdcd551fa92b4
|
|
BLAKE2b-256 checksum How to use checksums |
ddb81cda3f4a81075ecf7720d078cfda466aace3484ff2b5d1a3314eef05f7a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|
Release files / starlyng_bcm_connection-0.1.4-py3-none-any.whl
| Download URL | starlyng_bcm_connection-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8e5ec595c26cf642f31bd39470b81e587da677923e17e792ef577efe23096f5
|
|
BLAKE2b-256 checksum How to use checksums |
e3b2184ef36774a1c85052f5035c0378c0f4668e0a58b0f72e770e2f6c0f01af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|
Security for starlyng-bcm-connection 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.