mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Fix broken netstats ip forward polling (#5575)
This commit is contained in:
committed by
Neil Lathwood
parent
e62f2b0ffa
commit
f4b21ae279
@@ -1,39 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (!starts_with($device['os'], array('Snom', 'asa'))) {
|
||||
echo ' IP-FORWARD';
|
||||
|
||||
// Below have more oids, and are in trees by themselves, so we can snmpwalk_cache_oid them
|
||||
$oids = array('ipCidrRouteNumber');
|
||||
|
||||
unset($snmpstring, $fields, $snmpdata, $snmpdata_cmd, $rrd_create);
|
||||
|
||||
$rrd_def = array();
|
||||
$snmpstring = '';
|
||||
foreach ($oids as $oid) {
|
||||
$oid_ds = substr($oid, 0, 19);
|
||||
$rrd_create[] = "DS:$oid_ds:GAUGE:600:U:1000000"; // Limit to 1MPPS?
|
||||
$snmpstring .= ' IP-FORWARD-MIB::'.$oid.'.0';
|
||||
}
|
||||
|
||||
$data = snmp_get_multi($device, $snmpstring, '-OQUs', 'IP-FORWARD-MIB');
|
||||
|
||||
$oid = 'ipCidrRouteNumber';
|
||||
$fields = array();
|
||||
foreach ($oids as $oid) {
|
||||
if (is_numeric($data[0][$oid])) {
|
||||
$value = $data[0][$oid];
|
||||
} else {
|
||||
$value = 'U';
|
||||
}
|
||||
$rrd_def = "DS:$oid:GAUGE:600:U:5000000";
|
||||
$data = snmp_get($device, 'IP-FORWARD-MIB::' . $oid . '.0', '-OQv');
|
||||
if (is_numeric($data)) {
|
||||
$value = $data;
|
||||
$fields[$oid] = $value;
|
||||
}
|
||||
|
||||
if (isset($data[0]['ipCidrRouteNumber'])) {
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'netstats-ip_forward', $tags, $fields);
|
||||
|
||||
$graphs['netstat_ip_forward'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids, $rrd_def, $data, $oid, $fields, $snmpstring, $tags);
|
||||
unset($oid, $rrd_def, $data, $fields, $tags);
|
||||
|
Reference in New Issue
Block a user