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:
@@ -25,6 +25,8 @@
|
||||
* @author Tony Murray <murraytony@gmail.com>
|
||||
*/
|
||||
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
|
||||
echo ' rrdcached';
|
||||
|
||||
$data = "";
|
||||
@@ -70,17 +72,16 @@ if ($agent_data['app'][$name]) {
|
||||
|
||||
|
||||
$rrd_name = array('app', $name, $app_id);
|
||||
$rrd_def = array(
|
||||
'DS:queue_length:GAUGE:600:0:U',
|
||||
'DS:updates_received:COUNTER:600:0:U',
|
||||
'DS:flushes_received:COUNTER:600:0:U',
|
||||
'DS:updates_written:COUNTER:600:0:U',
|
||||
'DS:data_sets_written:COUNTER:600:0:U',
|
||||
'DS:tree_nodes_number:GAUGE:600:0:U',
|
||||
'DS:tree_depth:GAUGE:600:0:U',
|
||||
'DS:journal_bytes:COUNTER:600:0:U',
|
||||
'DS:journal_rotate:COUNTER:600:0:U'
|
||||
);
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('queue_length', 'GAUGE', 0)
|
||||
->addDataset('updates_received', 'COUNTER', 0)
|
||||
->addDataset('flushes_received', 'COUNTER', 0)
|
||||
->addDataset('updates_written', 'COUNTER', 0)
|
||||
->addDataset('data_sets_written', 'COUNTER', 0)
|
||||
->addDataset('tree_nodes_number', 'GAUGE', 0)
|
||||
->addDataset('tree_depth', 'GAUGE', 0)
|
||||
->addDataset('journal_bytes', 'COUNTER', 0)
|
||||
->addDataset('journal_rotate', 'COUNTER', 0);
|
||||
|
||||
$fields = array();
|
||||
foreach (explode("\n", $data) as $line) {
|
||||
|
Reference in New Issue
Block a user