mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fad5aca1b7
* feature: Allow customisation of rrd step/heartbeat when creating new rrd files * revert defaults * added docs + webui config option * Move RrdDefinition to an Object to make them easier to create and remove the possibility of typos. * Fix style/lint issues and missing use statements * 3 more missing use statements * updated doc + moved schema file
24 lines
694 B
PHP
24 lines
694 B
PHP
<?php
|
|
|
|
use LibreNMS\RRD\RrdDefinition;
|
|
|
|
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 = new RrdDefinition();
|
|
$fields = array();
|
|
foreach ($etherlike_oids as $oid) {
|
|
$oid_ds = str_replace('dot3Stats', '', $oid);
|
|
$rrd_def->addDataset($oid_ds, 'COUNTER', null, 100000000000);
|
|
|
|
$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 ';
|
|
}
|