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
+4 -5
View File
@@ -23,7 +23,7 @@ if ($device['os'] != 'Snom') {
'ipInAddrErrors',
);
unset($snmpstring, $rrdupdate, $snmpdata, $snmpdata_cmd, $rrd_create);
unset($snmpstring, $fields, $snmpdata, $snmpdata_cmd, $rrd_create);
$rrd_file = $config['rrd_dir'].'/'.$device['hostname'].'/netstats-ip.rrd';
$rrd_create = $config['rrd_rra'];
@@ -36,7 +36,7 @@ if ($device['os'] != 'Snom') {
$data = snmp_get_multi($device, $snmpstring, '-OQUs', 'IP-MIB');
$rrdupdate = 'N';
$fields = array();
foreach ($oids as $oid) {
if (is_numeric($data[0][$oid])) {
@@ -45,8 +45,7 @@ if ($device['os'] != 'Snom') {
else {
$value = 'U';
}
$rrdupdate .= ":$value";
$fields[$oid] = $value;
}
if (isset($data[0]['ipOutRequests']) && isset($data[0]['ipInReceives'])) {
@@ -54,7 +53,7 @@ if ($device['os'] != 'Snom') {
rrdtool_create($rrd_file, $rrd_create);
}
rrdtool_update($rrd_file, $rrdupdate);
rrdtool_update($rrd_file, $fields);
$graphs['netstat_ip'] = true;
$graphs['netstat_ip_frag'] = true;
}