Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Professional Edition
Description
The function parse_ipmitool_sensor() is not working correctly due to the empty discrete value in includes/definitions/entities/sensors.inc.php.
The following statements in parse_ipmitool_sensor() (includes/entities/sensor.inc.php) returns true if the $unit is discrete:
if (isset($config['ipmi_unit'][$unit])) { |
and the code below (from OBS-3028) will never run:
} elseif ($unit == 'discrete') { |
because an empty value is set in the array, so isset() returns true.
The attached patch will remove empty value from the array. Another option could be checking is there is an actual value in the unit-array:
if (isset($config['ipmi_unit'][$unit]) && $config['ipmi_unit'][$unit]) { |
I see, the "ipmitool sdr" command might generate some more sensible output (it has an "ok" column) for discrete sensors instead of "ipmitool sensor".
Output from the same server:
ipmitool sensor
Chassis Intru | 0x0 | discrete | 0x0000| na | na | na | na | na | na
PS1 Status | 0x1 | discrete | 0x0100| na | na | na | na | na | na
PS2 Status | 0x1 | discrete | 0x0100| na | na | na | na | na | na
ipmitool sdr
Chassis Intru | 0x00 | ok
PS1 Status | 0x01 | ok
PS2 Status | 0x01 | ok