Anon
Anon

Reputation: 5163

Using IPMI inside a python script (OpenIPMI)

I'd like to use IPMI to set a machine to PXE boot (i.e. ipmitool -I lan -U username -P password -H ipaddress chassis bootdev pxe) and then power cycle it (i.e. ipmitool -I lan -U username -P password -H ipaddress chassis power cycle). However, I'd like to do this in a python script so I'm trying to use OpenIPMI and its python bindings.

I can't seem to find any documentation on OpenIPMI for a python script and I'm not sure how to correctly apply IPMI commands (making sure the machine is in the right state so the commands don't fail). Can someone please show me some pointers or resources on using OpenIPMI (or an alternative) to operate IPMI commands in python? Thanks!

Upvotes: 3

Views: 13072

Answers (2)

Askar
Askar

Reputation: 523

I found the document IPMI – A Gentle Introduction with OpenIPMI very helpful. It gives good understanding where/how to get the information. As I understood Python can talk to "shared Library" over using Swig. I hope it will help you.

Upvotes: 0

John La Rooy
John La Rooy

Reputation: 304215

For something so simple it is much easier to just run those commands using the subprocess module.

However, if you still choose the openimpi module here is an example of how to use it:
http://www.mail-archive.com/[email protected]/msg01445.html

Upvotes: 3

Related Questions