From 58afe78ce46f3ed988383d964d42d905df1e4b4d Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Tue, 12 Dec 2017 20:28:30 -0600 Subject: [PATCH] fix ipmi sensors sending the wrong tags to influxdb (#7906) --- includes/polling/ipmi.inc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/polling/ipmi.inc.php b/includes/polling/ipmi.inc.php index fb6142ca79..2ad7f84de6 100644 --- a/includes/polling/ipmi.inc.php +++ b/includes/polling/ipmi.inc.php @@ -38,23 +38,23 @@ if (is_array($ipmi_rows)) { foreach ($ipmi_rows as $ipmisensors) { echo 'Updating IPMI sensor ' . $ipmisensors['sensor_descr'] . '... '; - $sensor = $ipmi_sensor[$ipmisensors['sensor_descr']][$ipmisensors['sensor_class']]['value']; + $sensor_value = $ipmi_sensor[$ipmisensors['sensor_descr']][$ipmisensors['sensor_class']]['value']; $unit = $ipmi_sensor[$ipmisensors['sensor_descr']][$ipmisensors['sensor_class']]['unit']; - echo $sensor . " $unit\n"; + echo "$sensor_value $unit\n"; $rrd_name = get_sensor_rrd_name($device, $ipmisensors); $rrd_def = RrdDefinition::make()->addDataset('sensor', 'GAUGE', -20000, 20000); $fields = array( - 'sensor' => $sensor, + 'sensor' => $sensor_value, ); $tags = array( - 'sensor_class' => $sensor['sensor_class'], - 'sensor_type' => $sensor['sensor_type'], - 'sensor_descr' => $sensor['sensor_descr'], - 'sensor_index' => $sensor['sensor_index'], + 'sensor_class' => $ipmisensors['sensor_class'], + 'sensor_type' => $ipmisensors['sensor_type'], + 'sensor_descr' => $ipmisensors['sensor_descr'], + 'sensor_index' => $ipmisensors['sensor_index'], 'rrd_name' => $rrd_name, 'rrd_def' => $rrd_def ); @@ -62,7 +62,7 @@ if (is_array($ipmi_rows)) { // FIXME warnings in event & mail not done here yet! dbUpdate( - array('sensor_current' => $sensor, + array('sensor_current' => $sensor_value, 'lastupdate' => array('NOW()')), 'sensors', 'poller_type = ? AND sensor_class = ? AND sensor_id = ?',