More influx changes

This commit is contained in:
laf
2015-12-18 11:15:56 +00:00
parent 3b976ba545
commit d48aa2789c
2 changed files with 33 additions and 27 deletions
+3
View File
@@ -44,6 +44,8 @@ function influxdb_connect() {
function influx_update($device,$measurement,$tags=array(),$fields) {
global $influxdb,$config,$console_color;
if ($influxdb !== false) {
echo "AHHHH $influxdb\n";
$tmp_fields = array();
$tmp_tags['hostname'] = $device['hostname'];
foreach ($tags as $k => $v) {
@@ -73,5 +75,6 @@ function influx_update($device,$measurement,$tags=array(),$fields) {
else {
print $console_color->convert('[%gInfluxDB Disabled%n] ', false);
}//end if
}//end if
}// end influx_update
+4 -1
View File
@@ -105,9 +105,12 @@ if (isset($options['f'])) {
$config['noinfluxdb'] = true;
}
if ($config['noinfluxdb'] !== true) {
if ($config['noinfluxdb'] !== true && $config['influxdb']['enable'] === true) {
$influxdb = influxdb_connect();
}
else {
$influxdb = false;
}
rrdtool_pipe_open($rrd_process, $rrd_pipes);