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
This commit is contained in:
Neil Lathwood
2017-02-23 22:45:50 +00:00
committed by GitHub
parent 0997172b37
commit fad5aca1b7
110 changed files with 1475 additions and 1119 deletions

View File

@@ -1,5 +1,7 @@
<?php
use LibreNMS\RRD\RrdDefinition;
if ($device['os'] != 'Snom') {
echo ' SNMP';
@@ -39,11 +41,10 @@ if ($device['os'] != 'Snom') {
$data = snmpwalk_cache_oid($device, 'snmp', array(), 'SNMPv2-MIB');
if (isset($data[0]['snmpInPkts'])) {
$rrd_def = array();
$rrd_def = new RrdDefinition();
$fields = array();
foreach ($oids as $oid) {
$oid_ds = substr($oid, 0, 19);
$rrd_def[] = "DS:$oid_ds:COUNTER:600:U:100000000000";
$rrd_def->addDataset($oid, 'COUNTER', null, 100000000000);
$fields[$oid] = isset($data[0][$oid]) ? $data[0][$oid] : 'U';
}