-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a plugin to get information from ipmitool #48
base: master
Are you sure you want to change the base?
Conversation
@AtaxyaNetwork , do you think that it will be possible to test this plugin on a 2crsi server in order to check that output are correct? Thanks a lot for your great help. |
For info, @AtaxyaNetwork tested it several weeks ago and it looks ok. Don't know if it needs to be checked with XO team but for me it looks ok to merge it. @stormi I added you as reviewer but feel free to add someone else :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Is ipmitool guaranteed to report information structured as expected by the code on every XCP-ng host? I see no error handling outside the automatic one that will report the exception raised by python. I just tried on a nested XCP-ng VM and got
[15:51 xcpng-ci-82-b1 ~]# ipmitool sdr list Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory
. - Code changes to this repository must come with unit tests in the same repository. Ideally also covering error handling.
This PR supersedes #47 |
@stormi in case of error it raises a |
In the Readme I see:
|
|
Yes, but then errors that mean nothing to users will be displayed to users in XO. We'll likely need something better than |
You will have "Error parameters: Command '['ipmitool', 'sdr', 'list']' failed with code: 1, stdout: '', stderr: 'Could not open device at /dev/ipmi0 or /dev/ipmi/0 or /dev/ipmidev/0: No such file or directory". It is the error parameters returned from the wrapper. What should I put instead? I mean it is the error :) |
Isn't XO that should handle this better? Not sure to see what you want instead of the "real error"? |
Depends what the API user (XO) would like. I think they would appreciate it if we provided a way to discriminate between "not supported on this hardware" and unexpected errors on supported hardware, for example. |
So we should add some XO people to review right? |
and I'm not sure to know how we can discriminate between "not supported on this hardware" and unexpected errors on supported hardware. |
476765f
to
9b30a15
Compare
- get_all_sensors: run `ipmitool sdr list` - returns a JSON string with all sensors - get_sensor: run `ipmitool sdr get <sensor>` - returns details about sensors passed as parameter - get_ipmi_lan: returns network info of the IPMI server as a JSON Signed-off-by: Guillaume <guillaume.thouvenin@vates.tech>
9b30a15
to
e4a6140
Compare
Commands are:
ipmitool sdr list
- returns a JSON string with all sensorsipmitool sdr get <sensor>
- returns details about sensors passed as parameter