librenms-librenms/includes/polling/port-etherlike.inc.php

25 lines
750 B
PHP
Raw Normal View History

<?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();
2015-07-13 20:10:26 +02:00
$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";
}
2015-07-13 20:10:26 +02:00
$fields = array();
2015-07-13 20:10:26 +02:00
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);
2015-08-19 20:58:02 +00:00
2015-07-13 20:10:26 +02:00
echo 'EtherLike ';
}