mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* 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
20 lines
619 B
PHP
20 lines
619 B
PHP
<?php
|
|
use LibreNMS\RRD\RrdDefinition;
|
|
|
|
if (!starts_with($device['os'], array('Snom', 'asa'))) {
|
|
echo ' IP-FORWARD';
|
|
|
|
$oid = 'ipCidrRouteNumber';
|
|
$fields = array();
|
|
$rrd_def = RrdDefinition::make()->addDataset($oid, 'GAUGE', null, 5000000);
|
|
$data = snmp_get($device, 'IP-FORWARD-MIB::' . $oid . '.0', '-OQv');
|
|
if (is_numeric($data)) {
|
|
$value = $data;
|
|
$fields[$oid] = $value;
|
|
$tags = compact('rrd_def');
|
|
data_update($device, 'netstats-ip_forward', $tags, $fields);
|
|
$graphs['netstat_ip_forward'] = true;
|
|
}
|
|
}
|
|
unset($oid, $rrd_def, $data, $fields, $tags);
|