Updated rrdtool_update() to use new array format

This commit is contained in:
laf
2015-08-18 16:26:55 +00:00
parent 84a0b8f676
commit 987634e463
65 changed files with 591 additions and 271 deletions

View File

@@ -79,7 +79,7 @@ foreach ($ipsec_array as $index => $tunnel) {
$rrd_create .= " DS:$oid_ds:COUNTER:600:U:1000000000";
}
$rrdupdate = 'N';
$fields = array();
foreach ($oids as $oid) {
if (is_numeric($tunnel[$oid])) {
@@ -88,18 +88,16 @@ foreach ($ipsec_array as $index => $tunnel) {
else {
$value = '0';
}
$rrdupdate .= ":$value";
$fields[$oid] = $value;
}
if (isset($tunnel['cikeTunRemoteValue'])) {
if (!file_exists($rrd_file)) {
rrdtool_create($rrd_file, $rrd_create);
}
rrdtool_update($rrd_file, $rrdupdate);
rrdtool_update($rrd_file, $fields);
// $graphs['ipsec_tunnels'] = TRUE;
}
}//end foreach
unset($rrd_file,$rrd_create,$rrdupdate,$oids, $data, $data_array, $oid, $tunnel);
unset($rrd_file,$rrd_create,$fields,$oids, $data, $data_array, $oid, $tunnel);