librenms-librenms/includes/polling/netstats/netstats-ip_forward.inc.php
Neil Lathwood fad5aca1b7 feature: Allow customisation of rrd step/heartbeat when creating new rrd files (#5947)
* 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
2017-02-23 22:45:50 +00:00

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);