Registry / devops / python-ipmi

python-ipmi

JSON →
library0.5.8pypypi✓ verified 87d ago

The `python-ipmi` library provides a pure Python API for interacting with devices via the Intelligent Platform Management Interface (IPMI) protocol. It supports IPMI version 2.0 and offers multiple communication interfaces, including native RMCP (IPMI over LAN), legacy RMCP (requiring the external `ipmitool`), IPMB (requiring a Total Phase Aardvark or Linux `ipmb-dev` driver), and a mock interface for testing. The current version is 0.5.8, released in December 2025, and it actively supports Python > 3.6, with Python 2.x deprecated.

pip install python-ipmi
INSTALL
IMPORT
SIG · PYTHON-IPMI
P
python-ipmi
devopspythonv0.5.8
Install
1.6s avg
Import
48ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.050s · 18.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.046s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyipmi
import pyipmi
Main library import for core IPMI functionality.
pyipmi.interfaces
import pyipmi.interfaces
Required for creating interface instances like RMCP or ipmitool backend.

This quickstart demonstrates how to establish an IPMI session using the native RMCP interface and retrieve the device ID. It relies on environment variables for sensitive connection details.

import os import pyipmi import pyipmi.interfaces # Environment variables for IPMI connection details IPMI_HOST = os.environ.get('IPMI_HOST', '192.168.1.100') IPMI_USER = os.environ.get('IPMI_USER', 'admin') IPMI_PASSWORD = os.environ.get('IPMI_PASSWORD', 'password') interface = None connection = None try: # Using the native RMCP interface (IPMI over LAN) interface = pyipmi.interfaces.create_interface('rmcp') connection = pyipmi.create_connection(interface) connection.target = pyipmi.Target(IPMI_HOST) connection.session.set_session_type_rmcp(username=IPMI_USER, password=IPMI_PASSWORD) print(f"Attempting to establish session to {IPMI_HOST}...") connection.session.establish() print("Session established successfully.") # Get Device ID command device_id_response = connection.get_device_id() print(f"Device ID: {device_id_response.device_id_string}") print(f"Manufacturer ID: {hex(device_id_response.manufacturer_id)}") print(f"Product ID: {hex(device_id_response.product_id)}") print(f"Firmware Revision: {device_id_response.firmware_revision.major}.{device_id_response.firmware_revision.minor}") except pyipmi.errors.IpmiError as e: print(f"IPMI Error: {e}") except Exception as e: print(f"An unexpected error occurred: {e}") finally: if connection: try: connection.session.close() print("Session closed.") except Exception as e: print(f"Error closing session: {e}")
Debug
Known issues
deprecatedPython 2.x support is deprecated. While older documentation mentions Python 3.x support being in beta, the latest PyPI and GitHub README state that Python > 3.6 is currently supported.
fix
Ensure your project uses Python 3.6 or newer. Upgrade your Python environment if necessary.
affects: <=0.5.x
gotchaUsing the 'ipmitool' interface type requires the external `ipmitool` binary to be installed and accessible in the system's PATH. This is not a pure Python solution and introduces an external dependency.
fix
If using `pyipmi.interfaces.create_interface('ipmitool')`, ensure `ipmitool` is installed on your system. For a pure Python solution, use the 'rmcp' interface.
affects: All versions
gotchaThe library may occasionally hang during `session.establish()` or certain IPMI command calls (e.g., `get_chassis_status()`), especially if the BMC is under heavy load or unresponsive.
fix
Implement robust error handling and timeouts around IPMI calls. Consider retries with exponential backoff. If using native RMCP, try switching to the 'ipmitool' backend (with `ipmitool` installed) to see if the issue persists, or test against a BMC simulator to narrow down if it's a library or BMC issue.
affects: All versions
gotchaInstalling `python-ipmi` via `conda install python-ipmi` is explicitly warned against in the documentation and will not work.
fix
Always use `pip install python-ipmi` for installation, even within a Conda environment.
affects: All versions
Errors
Common errors & fixes
Error. timeout: timed out
The IPMI target (BMC) did not respond within the expected timeframe during session establishment or command execution. This often indicates network issues, an incorrect target IP, or an unresponsive BMC.
fix
Verify the IPMI host IP address and network connectivity. Check if the BMC is powered on and its IPMI services are enabled. Consider increasing the timeout settings if network latency is expected, though this specific error message implies a hard timeout has been reached.
pyipmi.errors.CompletionCodeError: cc=0xYY desc=Invalid data field in Request
A command was sent with invalid or improperly formatted data for the specific BMC or IPMI version, or the BMC returned a non-success completion code indicating an invalid request.
fix
Consult the IPMI specification and your BMC's specific documentation to ensure the command parameters are correct. Verify the arguments passed to `python-ipmi` methods match the expected format for your target device. Check GitHub issues for similar problems with your specific BMC model.
ImportError: cannot import name 'pyipmi'
The `python-ipmi` library was not installed correctly or is not accessible in the current Python environment.
fix
Ensure the library is installed with `pip install python-ipmi`. Verify that the Python environment where you are running your script is the same one where the library was installed. If using virtual environments, activate it before running your script.
Upgrade
Version history
0.5.8latest on PyPI · released Dec 10, 2025
Audit
Dependencies
ipmitooloptionalRequired for 'ipmitool' backend interfaces (legacy RMCP, RMCP+, KCS) if chosen over native RMCP. Must be installed separately on the system PATH.
Total Phase AardvarkoptionalHardware device required for the 'aardvark' IPMB interface.
ipmb-dev driveroptionalLinux kernel driver for the IPMB interface, as an alternative to the Aardvark hardware.
Agent activity
12 hits · last 30 days
node
10
Resources
python-ipmi — pip install python-ipmi · libregistry