Arnaud Quette
2011-Jul-01 08:56 UTC
[Nut-upsdev] NUT PSU/IPMI driver using FreeIPMI (was: [Freeipmi-devel] in need of guidance...)
Hi Al, (FYI, I cc'ed the NUT developers list for info) 2011/6/30 Albert Chu <chu11 at llnl.gov>> Hi Arnaud, > > On Tue, 2011-06-28 at 12:19 -0700, Arnaud Quette wrote: > > Hi Al, > > > > 2011/6/28 Albert Chu <chu11 at llnl.gov> > > On Tue, 2011-06-28 at 02:28 -0700, Arnaud Quette wrote: > > (...) > > > I'm *very* interested in! > > > this could even serve as a simple example, shipped in the > > examples/ > > > directory. > > > > > > > > Unfortunately, it will require knowledge of the IPMI > > protocol/specification, which makes it difficult (and why I > > probably > > never bothered with an example). > > > > Everything is in the ipmi-fru and ipmi-sensors tools, however > > I imagine > > a lot of the options, permutations of things, IPMI spec > > details, etc. is > > what's making it confusing. > > > > Give me some time, and I'll try to "whittle" the ipmi-fru and > > ipmi-sensors tools into a far simpler example that can give > > you a basis > > for what you're trying to accomplish. > > > > sure, thanks a lot for your much appreciated proposition. > > since I have some hard deadlines, do you have any approximate idea on > > when you'd be able to release this? > > Attached is a simplified ipmi-fru that you can hopefully use to extract > the FRU information you seek. "gcc ipmi-fru-example.c -lfreeipmi" is > all you need to do. I took out a lot of stuff, and there a number of > special cases not handled. It may not work for all motherboards, but is > a good place to start. >awesome, thanks a lot Al! I'm starting to see the light, though I've not yet read the code thoroughly... I just have to check (maybe with libdetect) how to identify PSU, but I already got the following data by modifying ipmi_fru_parse_open_device_id() to specify a known PSU ID: FRU Board Language: English FRU Board Manufacturing Date/Time: 01/05/11 - 08:51:00 FRU Board Manufacturer: DELL FRU Board Product Name: PWR SPLY,717W,RDNT FRU Board Serial Number: CN179721130031 FRU Board Part Number: 0RN442A01 FRU Power Supply Overall Capacity: 717 Watts FRU Power Supply Peak VA: 0 VA FRU Power Supply Max Inrush Current: 0 Amps FRU Power Supply Inrush Interval: 0 ms FRU Power Supply Low End Input Voltage 1: 90000 mV FRU Power Supply High End Input Voltage 1: 264000 mV FRU Power Supply Low End Input Voltage 2: 0 mV FRU Power Supply High End Input Voltage 2: 0 mV FRU Power Supply Low End Acceptable Frequencey: 47 Hz FRU Power Supply High End Acceptable Frequencey: 63 Hz FRU Power Supply A/C Dropout Tolerance: 0 ms FRU Power Supply Predictive Fail Support: No FRU Power Supply Power Factor Correction Supported: No FRU Power Supply AutoSwitch Supprt: Yes FRU Power Supply Hot Swap Support: Yes FRU Power Supply Peak Capacity: 0 Watts FRU Power Supply Hold Up Time: 0 s FRU Power Supply Voltage 1: 12V FRU Power Supply Voltage 2: 12V FRU Power Supply Total Combined Wattage: 0 Watts> As for sensors, I figured you would probably want to use > libipmimonitoring, since it's at a much higher level. I would suggest > looking at the ipmimonitoring-sensors.c file. >indeed, that's what I understood. as told above, I just got to check libdetect for PSU identification, then everything should be alright. Hopefully that's enough to get you going. LMK if you need some help> deciphering the code more. >this should not be needed, but thanks for your kind proposition. but you should probably publish this code in examples/, with a name like "simple-ipmi-fru.c" or alike, and highlight this code sample a bit. thanks again, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110701/fe109a17/attachment-0001.html>
Arnaud Quette
2011-Jul-19 11:35 UTC
[Nut-upsdev] NUT PSU/IPMI driver using FreeIPMI (was: [Freeipmi-devel] in need of guidance...)
Hi Al, 2011/7/1 Albert Chu <chu11 at llnl.gov>> Hi Arnaud, > > On Fri, 2011-07-01 at 01:56 -0700, Arnaud Quette wrote: > > Hi Al, > > > > (FYI, I cc'ed the NUT developers list for info) > > > > 2011/6/30 Albert Chu <chu11 at llnl.gov> > > Hi Arnaud, > > > > On Tue, 2011-06-28 at 12:19 -0700, Arnaud Quette wrote: > > > > > Hi Al, > > > > > > 2011/6/28 Albert Chu <chu11 at llnl.gov> > > > On Tue, 2011-06-28 at 02:28 -0700, Arnaud Quette > > wrote: > > > (...) > > > > I'm *very* interested in! > > > > this could even serve as a simple example, shipped > > in the > > > examples/ > > > > directory. > > > > > > > > > > > > Unfortunately, it will require knowledge of the IPMI > > > protocol/specification, which makes it difficult > > (and why I > > > probably > > > never bothered with an example). > > > > > > Everything is in the ipmi-fru and ipmi-sensors > > tools, however > > > I imagine > > > a lot of the options, permutations of things, IPMI > > spec > > > details, etc. is > > > what's making it confusing. > > > > > > Give me some time, and I'll try to "whittle" the > > ipmi-fru and > > > ipmi-sensors tools into a far simpler example that > > can give > > > you a basis > > > for what you're trying to accomplish. > > > > > > sure, thanks a lot for your much appreciated proposition. > > > since I have some hard deadlines, do you have any > > approximate idea on > > > when you'd be able to release this? > > > > > > Attached is a simplified ipmi-fru that you can hopefully use > > to extract > > the FRU information you seek. "gcc ipmi-fru-example.c > > -lfreeipmi" is > > all you need to do. I took out a lot of stuff, and there a > > number of > > special cases not handled. It may not work for all > > motherboards, but is > > a good place to start. > > > > awesome, thanks a lot Al! > > I'm starting to see the light, though I've not yet read the code > > thoroughly... > > > > I just have to check (maybe with libdetect) how to identify PSU, but I > > already got the following data by modifying > > ipmi_fru_parse_open_device_id() to specify a known PSU ID: > > > > FRU Board Language: English > > FRU Board Manufacturing Date/Time: 01/05/11 - 08:51:00 > > FRU Board Manufacturer: DELL > > FRU Board Product Name: PWR SPLY,717W,RDNT > > FRU Board Serial Number: CN179721130031 > > FRU Board Part Number: 0RN442A01 > > > > FRU Power Supply Overall Capacity: 717 Watts > > FRU Power Supply Peak VA: 0 VA > > FRU Power Supply Max Inrush Current: 0 Amps > > FRU Power Supply Inrush Interval: 0 ms > > FRU Power Supply Low End Input Voltage 1: 90000 mV > > FRU Power Supply High End Input Voltage 1: 264000 mV > > FRU Power Supply Low End Input Voltage 2: 0 mV > > FRU Power Supply High End Input Voltage 2: 0 mV > > FRU Power Supply Low End Acceptable Frequencey: 47 Hz > > FRU Power Supply High End Acceptable Frequencey: 63 Hz > > FRU Power Supply A/C Dropout Tolerance: 0 ms > > FRU Power Supply Predictive Fail Support: No > > FRU Power Supply Power Factor Correction Supported: No > > FRU Power Supply AutoSwitch Supprt: Yes > > FRU Power Supply Hot Swap Support: Yes > > FRU Power Supply Peak Capacity: 0 Watts > > FRU Power Supply Hold Up Time: 0 s > > FRU Power Supply Voltage 1: 12V > > FRU Power Supply Voltage 2: 12V > > FRU Power Supply Total Combined Wattage: 0 Watts > > > > As for sensors, I figured you would probably want to use > > libipmimonitoring, since it's at a much higher level. I would > > suggest > > looking at the ipmimonitoring-sensors.c file. > > > > indeed, that's what I understood. > > as told above, I just got to check libdetect for PSU identification, > > then everything should be alright. > > I assuming you mean libipmidetect? libipmidetect is primarily used for > detecting if ipmi over LAN exists, not for identifying any particular > component. Not sure if it would be any use for you. >understood. we may have needs in the future, to do the same detection over the network. but for now, I've released a preliminary version of 'nut-ipmipsu', which supports only FRU info retrieval. It is available in NUT trunk, includes an m4 macro (ready for pkgconfig, but currently using AC_CHECK_HEADERS/FUNCS), and an abstracted IPMI implementation (only provided by FreeIPMI). I still have to had the sensor's info, and have 2 questions for you: - is there a way to automatically determine which sensor is attached to an FRU? Ie, I've found that the first PSU is ID 2. But how do I know that sensor X is the one attached to this board? - the things I'm using to parse FRU (like ipmi_fru_parse_ctx_create) and other things (lie ipmi_ctx_find_inband) are not available in 0.7.17 (the base I'm working on, Ubuntu up to 11.04). I've dug quickly the ChangeLog, but was not able to identify clearly when these functions were added. What is the minimal FreeIPMI required?> > > Hopefully that's enough to get you going. LMK if you need > > some help > > deciphering the code more. > > > > this should not be needed, but thanks for your kind proposition. > > > > but you should probably publish this code in examples/, with a name > > like "simple-ipmi-fru.c" or alike, and highlight this code sample a > > bit. > > That's the plan eventually :P >so I've a minor patch for you (attached) ;) it fixes indentation (replace tabs by spaces), and a typo on 'frequenc*e*y'. it may also be interesting to give the example compilation line in the file header... cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110719/71b44bc3/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: fru-ex-fix.patch Type: application/mbox Size: 18236 bytes Desc: not available URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110719/71b44bc3/attachment-0001.bin>