bmctools.ipmi.ipmitool
IpmiTool
Simple Ipmitool wrapper. Requires ipmitool to be installed and available as a shell command. ipmi_command() can use used to run arbitrary ipmi commands and additional functions are added for common operations. NOTE: Currently, these will not run directly on stackstorm k8s, must be run through toolbox action.
Sample Usage: mynode = IpmiTool(10.206.137.50, admin, mypassword) sel_list = mynode.get_sel_list()
With server object:
mynode = Server(mapi, uuid) mynode.ipmitool.power_status()
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
host | str | — | |
user | str | — | |
password | str | — |
ipmitool_command
def ipmitool_command(command: str) -> strExecute arbitary ipmitool command.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
command | str | — |
Returns: str
power_status
def power_status() -> strGet the current power status of the system.
Returns: String output from ipmitool (e.g., ‘Chassis Power is on’).
Returns: str
power_off
def power_off() -> strIssue a hard power-off command.
Returns: String output from ipmitool.
Returns: str
power_on
def power_on() -> strIssue a power-on command.
Returns: String output from ipmitool.
Returns: str
power_reset
def power_reset() -> strIssue a hard power-reset command.
Returns: String output from ipmitool.
Returns: str
bmc_reset_warm
def bmc_reset_warm() -> strPerform a warm reset of the BMC controller.
Returns: String output from ipmitool.
Returns: str
bmc_reset_cold
def bmc_reset_cold() -> strPerform a cold reset of the BMC controller.
Returns: String output from ipmitool.
Returns: str
sel_list
def sel_list(elist: Optional[bool] = False, raw: Optional[bool] = False, age: Optional[bool] = None) -> Union[list, bool]Retrieve the System Event Log (SEL).
Args:
elist: If True, use extended list format (sel elist) for richer event details.
raw: If True, return the raw string output instead of a parsed list.
age: Filter events newer than this age string (e.g., ‘30d’, ‘12h’, ‘2h’).
Cannot be combined with raw.
Returns:
Parsed list of event dicts, raw string (if raw=True), or False if the
log is empty.
Raises:
ValueError: If both raw and age are specified.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
elist | Optional[bool] | False | |
raw | Optional[bool] | False | |
age | Optional[bool] | None |
Returns: Union[list, bool]
sol_deactivate
def sol_deactivate() -> strDeactivate an active Serial Over LAN (SOL) session.
Returns: String output from ipmitool.
Returns: str
sol_looptest
def sol_looptest(num_loops: Optional[int] = 1) -> strRun a Serial Over LAN loopback test.
Args: num_loops: Number of loopback iterations to run (default: 1).
Returns: String output from ipmitool.
Raises:
TypeError: If num_loops is not an integer.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
num_loops | Optional[int] | 1 |
Returns: str