librenms/includes/polling/port-etherlike.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

25 lines
750 B
PHP

<?php
if ($this_port['dot3StatsIndex'] and $port['ifType'] == 'ethernetCsmacd') {
$rrd_oldname= 'etherlike-'.$port['ifIndex']; // TODO: remove oldname check?
$rrd_name = getPortRrdName($port_id, 'dot3');
$rrd_def = array();
$rrd_create = $config['rrd_rra'];
foreach ($etherlike_oids as $oid) {
$oid = truncate(str_replace('dot3Stats', '', $oid), 19, '');
$rrd_def[] = "DS:$oid:COUNTER:600:U:100000000000";
}
$fields = array();
foreach ($etherlike_oids as $oid) {
$data = ($this_port[$oid] + 0);
$fields[$oid] = $data;
}
$tags = compact('ifName', 'rrd_name', 'rrd_def', 'rrd_oldname');
data_update($device,'dot3',$tags,$fields);
echo 'EtherLike ';
}