Merge pull request #2740 from paulgear/unified-data-storage-rrd-influx

First cut at unified data storage for rrdtool & influxdb
This commit is contained in:
Neil Lathwood
2016-01-21 23:31:09 +00:00
12 changed files with 171 additions and 202 deletions

View File

@@ -1139,25 +1139,17 @@ function save_mibs($device, $mibname, $oids, $mibdef, &$graphs)
$usedoids[$index][$obj] = $val;
// if there's a file from the previous version of MIB-based polling, rename it
if (rrd_file_exists($device, array($mibname, $mibdef[$obj]['object_type'], $index))
&& !rrd_file_exists($device, array($mibname, $mibdef[$obj]['shortname'], $index))) {
rrd_file_rename($device,
array($mibname, $mibdef[$obj]['object_type'], $index),
array($mibname, $mibdef[$obj]['shortname'], $index));
// Note: polling proceeds regardless of rename result
}
rrd_create_update(
$device,
array(
$mibname,
$mibdef[$obj]['shortname'],
$index,
),
array("DS:mibval:$type"),
array("mibval" => $val)
$tags = array(
'rrd_def' => array("DS:mibval:$type"),
'rrd_name' => array($mibname, $mibdef[$obj]['shortname'], $index),
'rrd_oldname' => array($mibname, $mibdef[$obj]['object_type'], $index),
'index' => $index,
'oid' => $mibdef[$obj]['oid'],
'module' => $mibdef[$obj]['module'],
'mib' => $mibdef[$obj]['mib'],
'object_type' => $obj,
);
data_update($device, 'mibval', $tags, $val);
}
}