API reference


class pyghmi.ipmi.command.Command(bmc=None, userid=None, password=None, port=623, onlogon=None, kg=None, privlevel=None, verifycallback=None, keepalive=True, **kwargs)

Send IPMI commands to BMCs.

This object represents a persistent session to an IPMI device (bmc) and allows the caller to reuse a single session to issue multiple commands. This class can be used in a synchronous (wait for answer and return) or asynchronous fashion (return immediately and provide responses by callbacks). Synchronous mode is the default behavior.

For asynchronous mode, simply pass in a callback function. It is recommended to pass in an instance method to callback and ignore the callback_args parameter. However, callback_args can optionally be populated if desired.

  • bmc – hostname or ip address of the BMC (default is local)

  • userid – username to use to connect (default to no user)

  • password – password to connect to the BMC (defaults to no password)

  • onlogon – function to run when logon completes in an asynchronous fashion. This will result in a greenthread behavior.

  • kg – Optional parameter to use if BMC has a particular Kg configured

  • verifycallback – For OEM extensions that use HTTPS, this function will be used to evaluate the certificate.

  • keepalive – If False, then an idle connection will logout rather than keepalive unless held open by console or ongoing activity.