Files
librenms-librenms/includes/polling/netstats-icmp.inc.php
Tony Murray 57650e4ffc Remove nfs requirement for distributed poller (with rrdtool 1.5+)
Use data_update instead of rrd_update/rrd_create and influx_update
Centralize rrd file check so we can check against a remote rrdcached server too
Use rrd_name() to generate rrd file names
2016-07-07 21:10:06 -05:00

55 lines
1.5 KiB
PHP

<?php
if ($device['os'] != 'Snom') {
echo ' ICMP';
// Below have more oids, and are in trees by themselves, so we can snmpwalk_cache_oid them
$oids = array(
'icmpInMsgs',
'icmpOutMsgs',
'icmpInErrors',
'icmpOutErrors',
'icmpInEchos',
'icmpOutEchos',
'icmpInEchoReps',
'icmpOutEchoReps',
'icmpInDestUnreachs',
'icmpOutDestUnreachs',
'icmpInParmProbs',
'icmpInTimeExcds',
'icmpInSrcQuenchs',
'icmpInRedirects',
'icmpInTimestamps',
'icmpInTimestampReps',
'icmpInAddrMasks',
'icmpInAddrMaskReps',
'icmpOutTimeExcds',
'icmpOutParmProbs',
'icmpOutSrcQuenchs',
'icmpOutRedirects',
'icmpOutTimestamps',
'icmpOutTimestampReps',
'icmpOutAddrMasks',
'icmpOutAddrMaskReps',
);
$data = snmpwalk_cache_oid($device, 'icmp', array(), 'IP-MIB');
$fields = $data[0];
if (isset($fields['icmpInMsgs']) && isset($fields['icmpOutMsgs'])) {
$rrd_def = array();
foreach ($oids as $oid) {
$oid_ds = truncate($oid, 19, '');
$rrd_def[] = "DS:$oid_ds:COUNTER:600:U:100000000000";
}
$tags = compact('rrd_def');
data_update($device,'netstats-icmp',$tags,$fields);
$graphs['netstat_icmp'] = true;
$graphs['netstat_icmp_info'] = true;
}
unset($oids, $data, $rrd_def, $fields, $tags);
}//end if