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: |
|
---|---|
Returns: | A Python dict with the following keys/values: .. code-block:: python
|
CLI Examples:
salt-call ipmi.get_channel_access channel=1
salt.modules.ipmi.
get_channel_info
(channel=14, **kwargs)¶Get channel info
Parameters: |
|
---|---|
Returns: |
|
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: |
|
---|---|
Returns: | name: (str) uid: (int) channel: (int) access:
|
CLI Examples:
salt-call ipmi.get_user uid=2
salt.modules.ipmi.
get_user_access
(uid, channel=14, **kwargs)¶Get user access
Parameters: |
|
---|---|
Returns: |
|
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: | name: (str) uid: (int) channel: (int) access:
|
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 |
Parameters: | link_auth -- User Link authentication |
---|
enable/disable (used to enable whether this user's name and password information will be used for link authentication, e.g. PPP CHAP) for the given channel. Link authentication itself is a global setting for the channel and is enabled/disabled via the serial/modem configuration parameters.
Parameters: | ipmi_msg -- User IPMI Messaging: |
---|
(used to enable/disable whether this user's name and password information will be used for IPMI Messaging. In this case, 'IPMI Messaging' refers to the ability to execute generic IPMI commands that are not associated with a particular payload type. For example, if IPMI Messaging is disabled for a user, but that user is enabled for activating the SOL payload type, then IPMI commands associated with SOL and session management, such as Get SOL Configuration Parameters and Close Session are available, but generic IPMI commands such as Get SEL Time are unavailable.)
Parameters: | privilege_level -- |
---|
User Privilege Limit. (Determines the maximum privilege level that the user is allowed to switch to on the specified channel.)
- callback
- user
- operator
- administrator
- proprietary
- no_access
Parameters: | kwargs --
|
---|
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