2015-05-19 19:58:46 +02:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($device['os'] != 'Snom') {
|
|
|
|
echo ' IP-FORWARD';
|
2015-05-19 19:58:46 +02:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
// Below have more oids, and are in trees by themselves, so we can snmpwalk_cache_oid them
|
|
|
|
$oids = array('ipCidrRouteNumber');
|
2015-05-19 19:58:46 +02:00
|
|
|
|
2015-08-18 16:26:55 +00:00
|
|
|
unset($snmpstring, $fields, $snmpdata, $snmpdata_cmd, $rrd_create);
|
2015-05-19 19:58:46 +02:00
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = array();
|
|
|
|
$snmpstring = '';
|
2015-07-13 20:10:26 +02:00
|
|
|
foreach ($oids as $oid) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$oid_ds = truncate($oid, 19, '');
|
|
|
|
$rrd_create[] = "DS:$oid_ds:GAUGE:600:U:1000000"; // Limit to 1MPPS?
|
2015-07-13 20:10:26 +02:00
|
|
|
$snmpstring .= ' IP-FORWARD-MIB::'.$oid.'.0';
|
|
|
|
}
|
2015-05-19 19:58:46 +02:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$data = snmp_get_multi($device, $snmpstring, '-OQUs', 'IP-FORWARD-MIB');
|
2015-05-19 19:58:46 +02:00
|
|
|
|
2015-08-18 16:26:55 +00:00
|
|
|
$fields = array();
|
2015-07-13 20:10:26 +02:00
|
|
|
foreach ($oids as $oid) {
|
|
|
|
if (is_numeric($data[0][$oid])) {
|
|
|
|
$value = $data[0][$oid];
|
2016-08-28 12:32:58 -05:00
|
|
|
} else {
|
2015-07-13 20:10:26 +02:00
|
|
|
$value = 'U';
|
|
|
|
}
|
2015-08-18 16:26:55 +00:00
|
|
|
$fields[$oid] = $value;
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($data[0]['ipCidrRouteNumber'])) {
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
2016-08-28 12:32:58 -05:00
|
|
|
data_update($device, 'netstats-ip_forward', $tags, $fields);
|
2015-08-19 20:58:02 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$graphs['netstat_ip_forward'] = true;
|
2015-05-19 19:58:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
unset($oids, $rrd_def, $data, $oid, $fields, $snmpstring, $tags);
|