mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated rrdtool_update() to use new array format
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user