logicminds / rubyipmi

Command line wrapper for ipmitool and freeipmi
GNU Lesser General Public License v2.1
35 stars 32 forks source link

Ipmitool::Sensors#parse overwrites same name Sensor #18

Open hoshi-sano opened 10 years ago

hoshi-sano commented 10 years ago

Hi. I'm using rubyipmi and am troubled.

At a certain environment, Rubyipmi::Ipmitool::Sensors#getsensors returns the data like below.

Ambient          | 27.500     | degrees C  | ok    | na        | 1.000     | 6.000     | 37.000    | 42.000    | na        
Systemboard      | 32.000     | degrees C  | ok    | na        | na        | na        | 60.000    | 65.000    | na        
CPU1             | 42.000     | degrees C  | ok    | na        | na        | na        | 93.000    | 97.000    | na        
CPU2             | 39.000     | degrees C  | ok    | na        | na        | na        | 93.000    | 97.000    | na        
DIMM-1A          | 30.000     | degrees C  | ok    | na        | na        | na        | 78.000    | 82.000    | na        
...(snip)...
Ambient          | 0x1        | discrete   | 0x0280| na        | na        | na        | na        | na        | na        
CPU1             | 0x0        | discrete   | 0x8080| na        | na        | na        | na        | na        | na        
CPU2             | 0x0        | discrete   | 0x8080| na        | na        | na        | na        | na        | na        
DIMM-1A          | 0x0        | discrete   | 0x0280| na        | na        | na        | na        | na        | na        
...(snip)...

When I execute Rubyipmi::Ipmitool::Sensors#list at this environment, only "discrete" values are returned. (0x1, 0x0, 0x0, ...) Because Rubyipmi::Ipmitool::Sensors#parse overwrites Sensor that have same name.

I want to get both of "threshold data" (the former in above example) and "discrete data" by Rubyipmi::Ipmitool::Sensors#list. Do you have the plan improving this?

Thanks!

logicminds commented 10 years ago

Interesting... How does one know the differences between the sensor data then? I use the name as the unique key so I could see how this doesn't work but why would a manufacture use the same sensor name twice?

About the only solution I can think of is combining the sensor name sensor type to a new unique key and use the name as a different field. How are you using the discrete values? Aka. why do you need this?

example:

Sensor['keyname'] = 'discrete-sensorname'