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