Changes are from:
https://gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/d09e23fea99664859bf00f3eae80d8720992d68c#dade58c051d057633b161944993db070adc93aa0 collection of M4 and Kent support - 12032015
https://gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/aa741a6c25a0a3c3b3cb1cafda3d36c2e811a16e fix the issue #1, #2, #8 in the review process
https://gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/2cf9bab8cee7f53f85b573149105436608d7036a Fix bug 50752 [Kent2U4N_SW][LXCA]LED State on Light Path section does not correspond the real state and bug 50756 [Kent2U4N_SW][LXCA]Event name on Alerts page is not correct .
https://gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/c11863bdc8c67797403c27d19c045b85ccdf226f Port fix in v111 to master
Change-Id: I7220b90baeb10e13f8e658505a41b358694eb8ac
pyghmi
Pyghmi is a pure Python (mostly IPMI) server management library.
Building and installing
(These instructions have been tested on CentOS 7)
Clone the repository, generate the RPM and install it:
$ git clone https://github.com/openstack/pyghmi.git
$ cd pyghmi/
$ python setup.py bdist_rpm
$ sudo rpm -ivh dist/pyghmi-*.noarch.rpm
Using
There are a few use examples in the bin folder:
fakebmc: simply fakes a BMC that supports a few IPMI commands (useful for testing)pyghmicons: a remote console based on SOL redirection over IPMIpyghmiutil: an IPMI client that supports a few direct uses of pyghmi (also useful for testing and prototyping new features)virshbmc: a BMC emulation wrapper using libvirt
Extending
If you plan on adding support for new features, you'll most likely be interested
in adding your methods to pyghmi/ipmi/command.py. See methods such as
get_users and set_power for examples of how to use internal mechanisms to
implement new features. And please, always document new methods.
Sometimes you may want to implement OEM-specific code. For example, retrieving firmware version information is not a part of standard IPMI, but some servers are known to support it via custom OEM commands. If this is the case, follow these steps:
- Add your generic retrieval function (stub) to the
OEMHandlerclass inpyghmi/ipmi/oem/generic.py. And please, document its intent, parameters and expected return values. - Implement the specific methods that your server supports in subdirectories in
the
oemfolder (consider thelenovosubmodule as an example). A OEM folder will contain at least one class inheriting fromOEMHandler, and optionally helpers for running and parsing custom OEM commands. - Register mapping policies in
pyghmi/ipmi/oem/lookup.pyso pyghmi knows how to associate a BMC session with the specific OEM code you implemented.
A good way of testing the new feature is using bin/pyghmiutil. Just add an
extension for the new feature you just implemented (as a new command) and call
it from the command line:
$ IPMIPASSWORD=passw0rd bin/pyghmiutil [BMC IP address] username my_new_feature_command