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 (#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:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
$name = 'drbd';
|
||||
$app_instance = $app['app_instance'];
|
||||
@@ -12,19 +13,18 @@ foreach (explode('|', $agent_data['app'][$name][$app_instance]) as $part) {
|
||||
}
|
||||
|
||||
$rrd_name = array('app', $name, $app_instance);
|
||||
$rrd_def = array(
|
||||
'DS:ns:DERIVE:600:0:125000000000',
|
||||
'DS:nr:DERIVE:600:0:125000000000',
|
||||
'DS:dw:DERIVE:600:0:125000000000',
|
||||
'DS:dr:DERIVE:600:0:125000000000',
|
||||
'DS:al:DERIVE:600:0:125000000000',
|
||||
'DS:bm:DERIVE:600:0:125000000000',
|
||||
'DS:lo:GAUGE:600:0:125000000000',
|
||||
'DS:pe:GAUGE:600:0:125000000000',
|
||||
'DS:ua:GAUGE:600:0:125000000000',
|
||||
'DS:ap:GAUGE:600:0:125000000000',
|
||||
'DS:oos:GAUGE:600:0:125000000000'
|
||||
);
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('ns', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('nr', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('dw', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('dr', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('al', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('bm', 'DERIVE', 0, 125000000000)
|
||||
->addDataset('lo', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('pe', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('ua', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('ap', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('oos', 'GAUGE', 0, 125000000000);
|
||||
|
||||
|
||||
$fields = array(
|
||||
|
||||
Reference in New Issue
Block a user