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]) { |