Revisiting this old topic and my desire to try and absolutely minimize
my process overhead I discovered the perl bindings to ipmi in
OpenIPMI-perl, so I installed it. Alas, there's virtually no
documentation! I've been looking around and suspect at minimum I'll
need to know how to use the basic ipmi command language and found the
documentation very confusing. Perhaps ipmi to too complex to describe
in simple terms, but I'd think a few examples would go a long way. I
did find openipmicmd and the man page has lots of descriptions of
command syntax but no examples. After a very long time I figured out I
could do
openipmicmd smi /dev/ipmi0
and establish some sort of a connection and that's about as far as I
got. I think the command I want to use is of the form
0f lun netfn cmd [data1 [data2 ...]]
Send a command to the BMC you are connected to.
but not even a hint of what an command might actually look like.
Nowhere could I find a description of what a lun, netfn or cmd would
look like. Does a cmd map to something like ipmitool's 'sdr' command or
something totally different.
I even had the bright idea of maybe looking at some ipmitool verbose
output to help me figure out how to translate a simple ipmitool command
into real ipmi-speak, but that output didn't help either. Perhaps this
is way out of the scope of ipmitool, but it'd be pretty neat if there
was a form of debugging output that would dump the commands one would
use with something like openipmicmd.
I guess the thing with IPMI is it's very powerful and can do lots of
things and as a result needs a very robust command language. But it's
that robustness that make it very hard to approach and perhaps that's
why ipmitool was written. It sure helps hide all that complexity!
-mark
Cress, Andrew R wrote:
> Here's how I did that with ipmiutil. The optarg is a list of sensor
> type/groups, separated by commas. It parses those by the strings for IPMI
> Sensor Type from Table 42-3, then stores the resulting bytes in an array that
> is used when making a pass through the SDRs.
> You can look at the code for this in ipmiutil sensor.c under SVN.
>
> Andy
>
> Sample output:
> # ipmiutil sensor -g "fan,Power Unit,power supply"
> ipmiutil ver 2.31
> sensor: version 2.31
> -- BMC version 0.20, IPMI version 2.0
> _ID_ SDR_Type_xx ET Own Typ S_Num Sens_Description Hex & Interp Reading
> 000e SDR Full 01 01 20 m 04 snum 50 Fan 1A = 70 OK 7728.00 RPM
> 000f SDR Full 01 01 20 m 04 snum 51 Fan 1B = 6b OK 5457.00 RPM
> 0010 SDR Full 01 01 20 m 04 snum 52 Fan 2A = 68 OK 7176.00 RPM
> 0011 SDR Full 01 01 20 m 04 snum 53 Fan 2B = 6a OK 5406.00 RPM
> 0012 SDR Full 01 01 20 m 04 snum 54 Fan 3A = 6d OK 7521.00 RPM
> 0013 SDR Full 01 01 20 m 04 snum 55 Fan 3B = 6a OK 5406.00 RPM
> 0014 SDR Full 01 01 20 m 04 snum 56 Fan 4A = 6f OK 7659.00 RPM
> 0015 SDR Full 01 01 20 m 04 snum 57 Fan 4B = 69 OK 5355.00 RPM
> 0016 SDR Full 01 01 20 m 04 snum 58 Fan 5 = 63 OK 6534.00 RPM
> 0020 SDR Comp 02 6f 20 a 09 snum 01 Power Unit = 00 c0 00 00 Enabled
> 0021 SDR Comp 02 0b 20 a 09 snum 02 Power Redundancy = 00 c0 01 00 Redundant
> 0029 SDR Comp 02 6f 20 a 08 snum 70 PS1 Status = 00 c0 01 00 Present
> 002a SDR Comp 02 6f 20 a 08 snum 71 PS2 Status = 00 c0 01 00 Present
> SDR IPMI sensor: Power On Hours = 8816 hours
> sensor, completed successfully
> #
>
> -----Original Message-----
> From: Mark Seger [mailto:[email protected]]
> Sent: Monday, December 01, 2008 8:38 AM
> To: Bernard Manjou
> Cc: [email protected]; 'Isabelle, Francois'; 'Carol Hebert'
> Subject: Re: [Ipmitool-devel] Optimizing the use of ipmitool
>
> Starting to actually implement something in collectl it occurs to me
> that if I have the commands in a file I need to make sure the file
> wasn't accidentally deleted by someone which while doable is one more
> pain... Are there any tricks to doing this sort of thing from a command
> line and avoiding the file? Another potential use might be if you're
> running diskless.
> -mark
>
> Bernard Manjou wrote:
>
>> Did you try 'ipmitool -S file exec cmdfile'
>>
>> Bernard
>>
>>
>>
>>> -----Message d'origine-----
>>> De : Mark Seger [mailto:[email protected]]
>>> Envoyé : 26 November 2008 15:19
>>> À : Isabelle, Francois
>>> Cc : [email protected]; Carol Hebert
>>> Objet : Re: [Ipmitool-devel] Optimizing the use of ipmitool
>>>
>>>
>>>
>>> Isabelle, Francois wrote:
>>>
>>>
>>>>
>>>>
>>>>
>>>>> I did discover the "ipmitool sdr get" command which the help says
>>>>> takes an id as a target but when I tried it, it didn't work!
>>>>>
>>>>>
>>>>>
>>>> And make sure you run:
>>>> ' ipmitool sdr dump <file>'
>>>> and
>>>> 'ipmitool sdr get "Power Meter" -S <file>'
>>>>
>>>> to skip over the lengthy discovery process (unless the
>>>>
>>>>
>>> sensor population is dynamic).
>>>
>>>
>>>>
>>>>
>>>>
>>> yes, I've been doing that. by my main problem still remains.
>>> I want to get 3 sensors: fans, temps and power and want to
>>> do it with a single ipmitool command if possible to make
>>> things more efficient and simply doing "ipmitool -S file sdr"
>>> with no args is a lot slower on some systems than individually doing:
>>>
>>> ipmitool -S file sdr type temp
>>> ipmitool -S file sdr type fan
>>> ipmitool -S file sdr type current # gets me the power.
>>>
>>> I don't recall it I mentioned this or not, but I'm the author
>>> of collectl, see - http://collectl.sourceforge.net/, which in
>>> many ways is similar to a performance data collection tool
>>> like sar, but add a lot more data types and provides a lot
>>> more ways to view the data. In any event, I've including
>>> ipmi sensor monitoring via ipmitool for fans and temperature
>>> sensors which is very cool, and now I want to add power
>>> monitoring but want to be as efficient as I can since
>>> collectl runs continuously. The idea here is to be able to
>>> correlate power consumption against cpu load and individual
>>> processes which is something a lot of people are interested
>>> in. Collectl is very efficient, typically using less than
>>> 0.1% of the cpu when sampling at a frequency of 10 seconds.
>>> By default I'm setting the frequency of ipmitool monitoring
>>> to once every couple of minutes since it does have more
>>> overhead than reading data out of proc. My fear is having to
>>> invoke it multiple times/sample is too heavyweight and so I'm
>>> looking for alternatives. If you can't specify multiple
>>> sensors with a single command is there any thought/interest
>>> is providing that as an enhancement? I think it would be a
>>> very useful (and probably not that
>>> hard) thing to do...
>>>
>>> -mark
>>>
>>>
>>>
>>>> Francois Isabelle
>>>>
>>>> -----Message d'origine-----
>>>> De : Carol Hebert [mailto:[email protected]] Envoyé : 25 novembre 2008
>>>> 15:45 À : Mark Seger Cc : [email protected]
>>>> Objet : Re: [Ipmitool-devel] Optimizing the use of ipmitool
>>>>
>>>> Quoting Mark Seger <[email protected]>:
>>>>
>>>>
>>>>
>>>>
>>>>> I did discover the "ipmitool sdr get" command which the help says
>>>>> takes an id as a target but when I tried it, it didn't
>>>>>
>>>>>
>>> work! First I
>>>
>>>
>>>>> did this to get a list of IDs:
>>>>>
>>>>> [r...@hadesn1 ~]# ipmitool sdr elist
>>>>> UID Light | 01h | ok | 23.1 | 0 unspecified
>>>>> Int. Health LED | 02h | ok | 23.2 | 0 unspecified
>>>>> VRM 1 | 03h | lcr | 9.1 | 0 unspecified
>>>>> VRM 2 | 04h | lcr | 9.2 | 0 unspecified
>>>>> Temp 1 | 05h | ok | 7.1 | 47 degrees C
>>>>> Temp 2 | 06h | ok | 3.1 | 34 degrees C
>>>>> Temp 3 | 07h | ok | 3.2 | 30 degrees C
>>>>> Temp 4 | 08h | ok | 3.3 | 30 degrees C
>>>>> Temp 5 | 09h | ok | 3.4 | 32 degrees C
>>>>> Temp 6 | 0Ah | ok | 3.5 | 30 degrees C
>>>>> Temp 7 | 0Bh | ok | 3.6 | 30 degrees C
>>>>> Temp 8 | 0Ch | ok | 8.1 | 57 degrees C
>>>>> Temp 9 | 0Dh | ok | 39.1 | 24 degrees C
>>>>> Virtual Fan | 0Eh | lnc | 7.2 | 37.24 unspecifi
>>>>> Enclosure Status | 0Fh | ok | 23.3 | 0 unspecified
>>>>> Power Meter | 10h | lcr | 7.3 | 204 Watts
>>>>>
>>>>> but when I did this, it didn't:
>>>>> [r...@hadesn1 ~]# ipmitool sdr get 10h Unable to find
>>>>>
>>>>>
>>> sensor id '10h'
>>>
>>>
>>>>>
>>>>>
>>>>>
>>>> Try ' ipmitool sdr get "Power Meter" '
>>>>
>>>> Hope this helps,
>>>>
>>>> Carol
>>>>
>>>>
>>>>
>>>>
>>>>
>>> ----------------------------------------------------------------------
>>>
>>>
>>>> --- This SF.Net email is sponsored by the Moblin Your Move
>>>>
>>>>
>>> Developer's
>>>
>>>
>>>> challenge Build the coolest Linux based applications with
>>>>
>>>>
>>> Moblin SDK &
>>>
>>>
>>>> win great prizes Grand prize is a trip for two to an Open
>>>>
>>>>
>>> Source event
>>>
>>>
>>>> anywhere in the world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Ipmitool-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
>>>>
>>>>
>>>>
>>> --------------------------------------------------------------
>>> -----------
>>> This SF.Net email is sponsored by the Moblin Your Move
>>> Developer's challenge Build the coolest Linux based
>>> applications with Moblin SDK & win great prizes Grand prize
>>> is a trip for two to an Open Source event anywhere in the
>>> world http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Ipmitool-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
>>>
>>>
>>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Ipmitool-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
>>
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Ipmitool-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ipmitool-devel
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ipmitool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel