logicminds / rubyipmi

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

freeipmi failed parsing on sensor data #37

Open ohadlevy opened 8 years ago

ohadlevy commented 8 years ago

when using: /usr/sbin/ipmi-sensors --hostname=fox02 --driver-type=LAN_2_0 --no-header-output --output-sensor-state --entity-sensor-names --config-file=/tmp/20151102-15221-ce12l

the following is observed:

logs
4   | System Board 1 SEL Fullness     | Event Logging Disabled      | Nominal  | N/A        | N/A   | 'OK'
5   | System Board 1 12V Standby      | Voltage                     | Nominal  | 12.16      | V     | 'OK'
6   | System Board 1 5V Standby       | Voltage                     | Nominal  | 5.08       | V     | 'OK'
7   | System Board 1 5V               | Voltage                     | Nominal  | 5.03       | V     | 'OK'
8   | System Board 1 3.3V Standby     | Voltage                     | Nominal  | 3.43       | V     | 'OK'
9   | System Board 1 3.3V             | Voltage                     | Nominal  | 3.35       | V     | 'OK'
11  | System Board 1 MEZZ1 TEMP       | Temperature                 | Nominal  | 41.00      | C     | 'OK'
2   | Processor 2 P2 ThermalTrip      | Processor                   | N/A      | N/A        | N/A   | N/A
1   | Processor 1 P1 ThermalTrip      | Processor                   | N/A      | N/A        | N/A   | N/A
3   | Processor 1 CPU ERR2            | Processor                   | N/A      | N/A        | N/A   | N/A
12  | Processor 1 CPU1 Temp           | Temperature                 | Nominal  | 44.00      | C     | 'OK'
13  | Processor 1 CPU2 Temp           | Temperature                 | N/A      | N/A        | C     | N/A
14  | Processor 1 DIMM ZONE 1 Temp    | Temperature                 | Nominal  | 35.00      | C     | 'OK'
15  | Processor 1 DIMM ZONE 2 Temp    | Temperature                 | N/A      | N/A        | C     | N/A
18  | Processor 1 PCH Temp            | Temperature                 | Nominal  | 43.00      | C     | 'OK'
19  | System Board 2 Watchdog         | Watchdog 2                  | Nominal  | N/A        | N/A   | 'OK'
22  | Power Supply 1 AC lost          | Power Unit                  | N/A      | N/A        | N/A   | N/A
23  | Memory Module Memory            | Memory                      | N/A      | N/A        | N/A   | N/A
25  | Power Supply 2 Sys Pwr Monitor  | System ACPI Power State     | N/A      | N/A        | N/A   | N/A
26  | Battery Battery low             | Battery                     | Nominal  | N/A        | N/A   | 'OK'
29  | Processor 1 M2090 Temp 1        | Temperature                 | N/A      | N/A        | C     | N/A
30  | Processor 1 M2090 PWR 1         | Other Units Based Sensor    | N/A      | N/A        | W     | N/A
31  | Processor 1 M2090 Temp 2        | Temperature                 | N/A      | N/A        | C     | N/A
32  | Processor 1 M2090 PWR 2         | Other Units Based Sensor    | N/A      | N/A        | W     | N/A
35  | Power Supply 2 M2090 STATUS 1   | OEM Reserved                | N/A      | N/A        | N/A   | N/A
36  | Power Supply 2 M2090 STATUS 2   | OEM Reserved                | N/A      | N/A        | N/A   | N/A
38  | Add-in Card GPGPU Insert        | Add In Card                 | N/A      | N/A        | N/A   | N/A
39  | Processor 1 MIC Temp 1          | Temperature                 | N/A      | N/A        | C     | N/A
40  | Processor 1 MIC PWR 1           | Other Units Based Sensor    | N/A      | N/A        | W     | N/A
48  | Processor 1 MIC Temp 2          | Temperature                 | N/A      | N/A        | C     | N/A
16  | Processor 1 MIC PWR 2           | Other Units Based Sensor    | N/A      | N/A        | W     | N/A
45  | Power Supply 2 MIC STATUS 1     | OEM Reserved                | N/A      | N/A        | N/A   | N/A
46  | Power Supply 2 MIC STATUS 2     | OEM Reserved                | N/A      | N/A        | N/A   | N/A
42  | Chassis Specific NPDB Status    | Power Unit                  | N/A      | N/A        | N/A   | N/A
53  | Chassis Specific SC FW Status   | Management Subsystem Health | Nominal  | N/A        | N/A   | 'OK'
49  | Air Inlet Inlet Temp            | Temperature                 | Nominal  | 26.00      | C     | 'OK'
51  | Power Management Input Voltage  | Voltage                     | Nominal  | 11.97      | V     | 'OK'
52  | Power Management Input Current  | Current                     | Nominal  | 3.00       | A     | 'OK'
54  | Chassis Specific PSU 1 Status   | Power Supply                | Critical | N/A        | N/A   | 'Presence detected' 'Power Supply Failure detected' 'Power Supply input lost (AC/DC)'
96  | Fan 96 FAN_1                    | Fan                         | Nominal  | 6790.00    | RPM   | 'OK'
97  | Fan 97 FAN_2                    | Fan                         | Nominal  | 6790.00    | RPM   | 'OK'
98  | Fan 98 FAN_3                    | Fan                         | Nominal  | 6790.00    | RPM   | 'OK'
99  | Fan 99 FAN_4                    | Fan                         | Nominal  | 6860.00    | RPM   | 'OK'
112 | Chassis Specific PSU Mismatch   | Power Supply                | Nominal  | N/A        | N/A   | 'OK'
113 | Chassis Specific PSU Redundancy | Power Supply                | Nominal  | N/A        | N/A   | 'OK'

E, [2015-11-02T17:44:10.262389 #15221] ERROR -- : undefined method `gsub' for nil:NilClass
D, [2015-11-02T17:44:10.262490 #15221] DEBUG -- : /home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:93:in `normalize'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:88:in `initialize'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:76:in `new'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:76:in `block in parse'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:74:in `each'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:74:in `parse'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:15:in `list'
/home/ohad/.rvm/gems/ruby-2.1.1/gems/rubyipmi-0.10.0/lib/rubyipmi/freeipmi/commands/sensors.rb:30:in `fanlist'

this is using dell PowerEdge C6220

logicminds commented 8 years ago

Ill take a look at the parser. I have heard others complain but your the first to provide output.

ohadlevy commented 8 years ago

lucky me ;) thanks @logicminds

logicminds commented 8 years ago

What version of freeipmi are you using?

logicminds commented 8 years ago

So I am assuming the output you posted is from the result of the same command rubyipmi used. If it is this looks to be a vendor issue with sensor data. If you look at my fixtures, which is what I based the parser on the output is different and provides much more detail: https://github.com/logicminds/rubyipmi/blob/master/spec/fixtures/freeipmi/sensors.txt

Can you run the sensor command again without the flag (--no-header-output) so I can see what your system is returning and which headers are for which sensor?

logicminds commented 8 years ago

I created a new branch: https://github.com/logicminds/rubyipmi/tree/gh-37 and added some unit tests that parse the output you provided. The parser seems to work as is, but I am wondering if the output you provided is different than the output given by freeipmi somehow.

You can test this out on your system by checking out gh-37 branch and running bundle exec rspec spec/unit/freeipmi/sensors_spec.rb