From 32f5980523f1be4799fcc53d76e01bd12f34e4e9 Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 23 Dec 2015 15:12:09 +0000 Subject: [PATCH] Some more tweaks --- includes/influxdb.inc.php | 4 ++++ includes/polling/ports.inc.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/influxdb.inc.php b/includes/influxdb.inc.php index 7f490c7e67..85694953a9 100644 --- a/includes/influxdb.inc.php +++ b/includes/influxdb.inc.php @@ -48,6 +48,10 @@ function influx_update($device,$measurement,$tags=array(),$fields) { $tmp_fields = array(); $tmp_tags['hostname'] = $device['hostname']; foreach ($tags as $k => $v) { + $v = preg_replace(array('/ /','/,/','/=/'),array('\ ','\,','\='), $v); + if (empty($v)) { + $v = '_blank_'; + } $tmp_tags[$k] = $v; } foreach ($fields as $k => $v) { diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index b0cc451c7c..ba6b186b91 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -486,7 +486,7 @@ foreach ($ports as $port) { $fields['ifInOctets_rate'] = $port['ifInOctets_rate']; $fields['ifOutOctets_rate'] = $port['ifOutOctets_rate']; - $tags = array('ifName' => '"'.$port['ifName'].'"', 'ifSpeed' => '"'.$port['ifSpeed'].'"', 'port_descr_type' => '"'.$port['port_descr_type'].'"'); + $tags = array('ifName' => $port['ifName'], 'port_descr_type' => $port['port_descr_type']); influx_update($device,'ports',$tags,$fields); // End Update IF-MIB