mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Chrony support (#12488)
* initial chrony implementation * remove unused import * add testing data * fix test data * fix tests Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
29
includes/html/graphs/application/chronyd_frequency.inc.php
Normal file
29
includes/html/graphs/application/chronyd_frequency.inc.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Seconds PPM';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
|
||||
$array = [
|
||||
'frequency' => ['descr' => 'Error rate'],
|
||||
'residual_frequency' => ['descr' => 'Ref clk offset'],
|
||||
'skew' => ['descr' => 'Sys clk skew'],
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $file";
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
28
includes/html/graphs/application/chronyd_root.inc.php
Normal file
28
includes/html/graphs/application/chronyd_root.inc.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Seconds';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
|
||||
$array = [
|
||||
'root_delay' => ['descr' => 'Root clk delay'],
|
||||
'root_dispersion' => ['descr' => 'Root clk disp.'],
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $file";
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Seconds PPM';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
|
||||
$array = [
|
||||
'frequency' => ['descr' => 'Estimated'],
|
||||
'frequency_skew' => ['descr' => 'Est. error'],
|
||||
];
|
||||
|
||||
$rrd_list = [];
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
d_echo('RRD "' . $rrd_filename . '" not found');
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
|
||||
$array = [
|
||||
'polling_rate' => ['descr' => 'Polling rate'],
|
||||
'last_rx' => ['descr' => 'Last RX'],
|
||||
'number_samplepoints' => ['descr' => '# sample pts'],
|
||||
'number_runs' => ['descr' => '# runs'],
|
||||
'span' => ['descr' => 'Sample span'],
|
||||
];
|
||||
|
||||
$rrd_list = [];
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
d_echo('RRD "' . $rrd_filename . '" not found');
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Seconds';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id'], $vars['source']]);
|
||||
$array = [
|
||||
'adjusted_offset' => ['descr' => 'Adjusted'],
|
||||
'measured_offset' => ['descr' => 'Measured'],
|
||||
'offset' => ['descr' => 'Estimated'],
|
||||
'estimated_error' => ['descr' => 'Est. error'],
|
||||
'stddev' => ['descr' => 'Std dev'],
|
||||
];
|
||||
|
||||
$rrd_list = [];
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
d_echo('RRD "' . $rrd_filename . '" not found');
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
26
includes/html/graphs/application/chronyd_stratum.inc.php
Normal file
26
includes/html/graphs/application/chronyd_stratum.inc.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Level';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
|
||||
$array = [
|
||||
'stratum' => ['descr' => 'Stratum'],
|
||||
];
|
||||
|
||||
$rrd_list = [];
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
d_echo('RRD "' . $rrd_filename . '" not found');
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
29
includes/html/graphs/application/chronyd_time.inc.php
Normal file
29
includes/html/graphs/application/chronyd_time.inc.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
require 'includes/html/graphs/common.inc.php';
|
||||
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Seconds';
|
||||
$rrd_filename = rrd_name($device['hostname'], ['app', 'chronyd', $app['app_id']]);
|
||||
$array = [
|
||||
'system_time' => ['descr' => 'Clock lag'],
|
||||
'last_offset' => ['descr' => 'Last offset'],
|
||||
'rms_offset' => ['descr' => 'Avg offset'],
|
||||
];
|
||||
|
||||
$i = 0;
|
||||
|
||||
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
foreach ($array as $ds => $var) {
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $var['descr'];
|
||||
$rrd_list[$i]['ds'] = $ds;
|
||||
$rrd_list[$i]['colour'] = \LibreNMS\Config::get("graph_colours.$colours.$i");
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo "file missing: $file";
|
||||
}
|
||||
|
||||
require 'includes/html/graphs/generic_multi_line.inc.php';
|
Reference in New Issue
Block a user