Support IPMI commands over LAN. This module does not talk to the local systems hardware through IPMI drivers. It uses a python module pyghmi.
depends: | Python module pyghmi. You can install pyghmi using pip: pip install pyghmi
|
---|---|
configuration: | The following configuration defaults can be define (pillar or config files): ipmi.config:
api_host: 127.0.0.1
api_user: admin
api_pass: apassword
api_port: 623
api_kg: None
Usage can override the config defaults: salt-call ipmi.get_user api_host=myipmienabled.system
api_user=admin api_pass=pass
uid=1
|
salt.modules.ipmi.
create_user
(uid, name, password, channel=14, callback=False, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs)¶create/ensure a user is created with provided settings.
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.create_user uid=2 name=steverweber api_host=172.168.0.7 api_pass=nevertell
salt.modules.ipmi.
fast_connect_test
(**kwargs)¶Returns True if connection success. This uses an aggressive timeout value!
Parameters: | kwargs --
|
---|
CLI Examples:
salt-call ipmi.fast_connect_test api_host=172.168.0.9
salt.modules.ipmi.
get_bootdev
(**kwargs)¶Get current boot device override information.
Provides the current requested boot device. Be aware that not all IPMI devices support this. Even in BMCs that claim to, occasionally the BIOS or UEFI fail to honor it. This is usually only applicable to the next reboot.
Parameters: | kwargs --
|
---|
CLI Example:
salt-call ipmi.get_bootdev api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.
get_channel_access
(channel=14, read_mode='non_volatile', **kwargs)¶:param kwargs:api_host='127.0.0.1' api_user='admin' api_pass='example' api_port=623
Parameters: |
|
---|
A Python dict with the following keys/values:
{
alerting:
per_msg_auth:
user_level_auth:
access_mode:{ (ONE OF)
0: 'disabled',
1: 'pre_boot',
2: 'always',
3: 'shared'
}
privilege_level: { (ONE OF)
1: 'callback',
2: 'user',
3: 'operator',
4: 'administrator',
5: 'proprietary',
}
}
CLI Examples:
salt-call ipmi.get_channel_access channel=1
salt.modules.ipmi.
get_channel_info
(channel=14, **kwargs)¶Get channel info
Parameters: |
|
---|
channel session supports:
- no_session: channel is session-less
- single: channel is single-session
- multi: channel is multi-session
- auto: channel is session-based (channel could alternate between
single- and multi-session operation, as can occur with a
serial/modem channel that supports connection mode auto-detect)
CLI Examples:
salt-call ipmi.get_channel_info
salt.modules.ipmi.
get_channel_max_user_count
(channel=14, **kwargs)¶Get max users in channel
Parameters: |
|
---|---|
Returns: | int -- often 16 |
CLI Examples:
salt-call ipmi.get_channel_max_user_count
salt.modules.ipmi.
get_health
(**kwargs)¶Get Summarize health
This provides a summary of the health of the managed system. It additionally provides an iterable list of reasons for warning, critical, or failed assessments.
good health: {'badreadings': [], 'health': 0}
Parameters: | kwargs --
|
---|
CLI Example:
salt-call ipmi.get_health api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.
get_power
(**kwargs)¶Get current power state
The response, if successful, should contain 'powerstate' key and either 'on' or 'off' to indicate current state.
Parameters: | kwargs --
|
---|
CLI Example:
salt-call ipmi.get_power api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.
get_sensor_data
(**kwargs)¶Get sensor readings
Iterates sensor reading objects
Parameters: | kwargs --
|
---|
CLI Example:
salt-call ipmi.get_sensor_data api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.
get_user
(uid, channel=14, **kwargs)¶Get user from uid and access on channel
Parameters: |
|
---|
return
name: (str) uid: (int) channel: (int) access: - callback (bool) - link_auth (bool) - ipmi_msg (bool) - privilege_level: (str)[callback, user, operatorm administrator, proprietary, no_access]
CLI Examples:
salt-call ipmi.get_user uid=2
salt.modules.ipmi.
get_user_access
(uid, channel=14, **kwargs)¶Get user access
Parameters: |
|
---|
return
channel_info: - max_user_count = maximum number of user IDs on this channel - enabled_users = count of User ID slots presently in use - users_with_fixed_names = count of user IDs with fixed names access: - callback - link_auth - ipmi_msg - privilege_level: [reserved, callback, user, operator administrator, proprietary, no_access]
CLI Examples:
salt-call ipmi.get_user_access uid=2
salt.modules.ipmi.
get_user_name
(uid, return_none_on_error=True, **kwargs)¶Get user name
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.get_user_name uid=2
salt.modules.ipmi.
get_users
(channel=14, **kwargs)¶get list of users and access information
Parameters: |
|
---|---|
Returns: |
|
CLI Examples:
salt-call ipmi.get_users api_host=172.168.0.7
salt.modules.ipmi.
raw_command
(netfn, command, bridge_request=None, data=(), retry=True, delay_xmit=None, **kwargs)¶Send raw ipmi command
This allows arbitrary IPMI bytes to be issued. This is commonly used for certain vendor specific commands.
Parameters: |
|
---|---|
Returns: | dict -- The response from IPMI device |
CLI Examples:
salt-call ipmi.raw_command netfn=0x06 command=0x46 data=[0x02]
# this will return the name of the user with id 2 in bytes
salt.modules.ipmi.
set_bootdev
(bootdev='default', persist=False, uefiboot=False, **kwargs)¶Set boot device to use on next reboot
Parameters: |
|
---|---|
Returns: | dict or True -- If callback is not provided, the response |
CLI Examples:
salt-call ipmi.set_bootdev bootdev=network persist=True
salt.modules.ipmi.
set_channel_access
(channel=14, access_update_mode='non_volatile', alerting=False, per_msg_auth=False, user_level_auth=False, access_mode='always', privilege_update_mode='non_volatile', privilege_level='administrator', **kwargs)¶Set channel access
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.set_channel_access privilege_level='administrator'
salt.modules.ipmi.
set_identify
(on=True, duration=600, **kwargs)¶Request identify light
Request the identify light to turn off, on for a duration, or on indefinitely. Other than error exceptions,
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.set_identify
salt.modules.ipmi.
set_power
(state='power_on', wait=True, **kwargs)¶Request power state change
Parameters: |
|
---|---|
Returns: | dict -- A dict describing the response retrieved |
CLI Examples:
salt-call ipmi.set_power state=shutdown wait=True
salt.modules.ipmi.
set_user_access
(uid, channel=14, callback=True, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs)¶Set user access
Parameters: |
|
---|---|
Parm callback: | User Restricted to Callback
|
CLI Examples:
salt-call ipmi.set_user_access uid=2 privilege_level='operator'
salt.modules.ipmi.
set_user_name
(uid, name, **kwargs)¶Set user name
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.set_user_name uid=2 name='steverweber'
salt.modules.ipmi.
set_user_password
(uid, mode='set_password', password=None, **kwargs)¶Set user password and (modes)
Parameters: |
|
---|---|
Returns: | True on success when mode = test_password, return False on bad password |
CLI Example:
salt-call ipmi.set_user_password api_host=127.0.0.1 api_user=admin api_pass=pass
uid=1 password=newPass
salt-call ipmi.set_user_password uid=1 mode=enable
salt.modules.ipmi.
user_delete
(uid, channel=14, **kwargs)¶Delete user (helper)
Parameters: |
|
---|
CLI Examples:
salt-call ipmi.user_delete uid=2