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,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
// Polls shoutcast statistics from script via SNMP
|
||||
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
$name = 'shoutcast';
|
||||
$app_id = $app['app_id'];
|
||||
|
||||
@@ -20,16 +23,15 @@ foreach ($servers as $item => $server) {
|
||||
list($host, $port) = explode(':', $data['0'], 2);
|
||||
|
||||
$rrd_name = array('app', $name, $app_id, $host . '_' . $port);
|
||||
$rrd_def = array(
|
||||
'DS:bitrate:GAUGE:600:0:125000000000',
|
||||
'DS:traf_in:GAUGE:600:0:125000000000',
|
||||
'DS:traf_out:GAUGE:600:0:125000000000',
|
||||
'DS:current:GAUGE:600:0:125000000000',
|
||||
'DS:status:GAUGE:600:0:125000000000',
|
||||
'DS:peak:GAUGE:600:0:125000000000',
|
||||
'DS:max:GAUGE:600:0:125000000000',
|
||||
'DS:unique:GAUGE:600:0:125000000000'
|
||||
);
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('bitrate', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('traf_in', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('traf_out', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('current', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('status', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('peak', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('max', 'GAUGE', 0, 125000000000)
|
||||
->addDataset('unique', 'GAUGE', 0, 125000000000);
|
||||
|
||||
$fields = array(
|
||||
'bitrate' => $data['1'],
|
||||
|
Reference in New Issue
Block a user