mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: ntp apps (#4333)
* updated nicecase function for ntp server and client app * ntp applications refactoring * removed agent for ntp-server: reported as not working * removed ntpd from agent polling. thx @murrant
This commit is contained in:
@@ -73,8 +73,11 @@ function nicecase($item)
|
||||
case 'nfs-v3-stats':
|
||||
return 'NFS v3 Stats';
|
||||
|
||||
case 'ntpd':
|
||||
return 'NTPD (Server)';
|
||||
case 'ntp-client':
|
||||
return 'NTP Client';
|
||||
|
||||
case 'ntp-server':
|
||||
return 'NTP Server';
|
||||
|
||||
case 'os-updates':
|
||||
return 'OS Updates';
|
||||
|
@@ -9,7 +9,7 @@ $colour_line = 'B3D0DB';
|
||||
$colour_area_max = 'FFEE99';
|
||||
$graph_max = 100;
|
||||
$unit_text = 'Frequency';
|
||||
$ntpclient_rrd = rrd_name($device['hostname'], array('app', 'ntpclient', $app['app_id']));
|
||||
$ntpclient_rrd = rrd_name($device['hostname'], array('app', 'ntp-client', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpclient_rrd)) {
|
||||
$rrd_filename = $ntpclient_rrd;
|
@@ -5,7 +5,7 @@ require 'includes/graphs/common.inc.php';
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Milliseconds';
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntpclient', $app['app_id']));
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntp-client', $app['app_id']));
|
||||
$array = array(
|
||||
'offset' => array('descr' => 'Offset'),
|
||||
'jitter' => array('descr' => 'Jitter'),
|
@@ -1,18 +1,9 @@
|
||||
<?php
|
||||
|
||||
// $units = "b";
|
||||
// $total_units = "B";
|
||||
// $colours_in = "greens";
|
||||
// $multiplier = "0";
|
||||
// $colours_out = "blues";
|
||||
$nototal = 1;
|
||||
|
||||
$ds_in = 'packets_recv';
|
||||
$ds_out = 'packets_sent';
|
||||
|
||||
$graph_title .= '::packets';
|
||||
$unit_text = 'Packets';
|
||||
|
||||
$colour_line_in = '330033';
|
||||
$colour_line_out = 'FF6600';
|
||||
$colour_area_in = 'AA66AA';
|
||||
@@ -20,11 +11,10 @@ $colour_area_out = 'FFDD88';
|
||||
$colour_area_in_max = 'CC88CC';
|
||||
$colour_area_out_max = 'FFEFAA';
|
||||
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
|
||||
$rrd_filename = $ntpdserver_rrd;
|
||||
}
|
||||
|
||||
// include("includes/graphs/generic_bits.inc.php");
|
||||
require 'includes/graphs/generic_duplex.inc.php';
|
@@ -6,7 +6,7 @@ $scale_min = 0;
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Buffer';
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
$array = array(
|
||||
'buffer_recv' => array('descr' => 'Received'),
|
||||
'buffer_used' => array('descr' => 'Used'),
|
@@ -9,7 +9,7 @@ $colour_line = 'B3D0DB';
|
||||
$colour_area_max = 'FFEE99';
|
||||
$graph_max = 100;
|
||||
$unit_text = 'Frequency';
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
|
||||
$rrd_filename = $ntpdserver_rrd;
|
@@ -5,7 +5,7 @@ require 'includes/graphs/common.inc.php';
|
||||
$scale_min = 0;
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Packets';
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
$array = array(
|
||||
'packets_drop' => array(
|
||||
'descr' => 'Dropped',
|
||||
@@ -31,5 +31,4 @@ if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||
echo "file missing: $file";
|
||||
}
|
||||
|
||||
// include("includes/graphs/generic_multi_line.inc.php");
|
||||
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
|
@@ -5,7 +5,7 @@ require 'includes/graphs/common.inc.php';
|
||||
$colours = 'mixed';
|
||||
$nototal = (($width < 224) ? 1 : 0);
|
||||
$unit_text = 'Milliseconds';
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$rrd_filename = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
$array = array(
|
||||
'offset' => array('descr' => 'Offset'),
|
||||
'jitter' => array('descr' => 'Jitter'),
|
@@ -9,7 +9,7 @@ $colour_line = '880000';
|
||||
$colour_area_max = 'FFCCCC';
|
||||
$graph_max = 0;
|
||||
$unit_text = 'Stratum';
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
|
||||
$rrd_filename = $ntpdserver_rrd;
|
18
html/includes/graphs/application/ntp-server_uptime.inc.php
Normal file
18
html/includes/graphs/application/ntp-server_uptime.inc.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$scale_min = 0;
|
||||
$ds = 'uptime';
|
||||
$colour_area = 'EEEEEE';
|
||||
$colour_line = '36393D';
|
||||
$colour_area_max = 'FFEE99';
|
||||
$graph_max = 0;
|
||||
$unit_text = 'Seconds';
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntp-server', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
|
||||
$rrd_filename = $ntpdserver_rrd;
|
||||
}
|
||||
|
||||
require 'includes/graphs/generic_simplex.inc.php';
|
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$scale_min = 0;
|
||||
$ds = 'uptime';
|
||||
// $colour_area = "CEFFCE";
|
||||
// $colour_line = "008800";
|
||||
$colour_area = 'EEEEEE';
|
||||
$colour_line = '36393D';
|
||||
$colour_area_max = 'FFEE99';
|
||||
$graph_max = 0;
|
||||
$unit_text = 'Seconds';
|
||||
$ntpdserver_rrd = rrd_name($device['hostname'], array('app', 'ntpdserver', $app['app_id']));
|
||||
|
||||
if (rrdtool_check_rrd_exists($ntpdserver_rrd)) {
|
||||
$rrd_filename = $ntpdserver_rrd;
|
||||
}
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= ' DEF:uptime='.$rrd_filename.':uptime:AVERAGE';
|
||||
$rrd_options .= ' CDEF:cuptime=uptime,86400,/';
|
||||
|
||||
if ($width < 224) {
|
||||
$rrd_options .= " 'COMMENT:Days Cur Min Max Avg\\n'";
|
||||
} else {
|
||||
$rrd_options .= " 'COMMENT:Days Current Minimum Maximum Average\\n'";
|
||||
}
|
||||
|
||||
$rrd_options .= ' AREA:cuptime#'.$colour_area.':';
|
||||
$rrd_options .= ' LINE1.25:cuptime#'.$colour_line.':Uptime';
|
||||
$rrd_options .= ' GPRINT:cuptime:LAST:%6.2lf';
|
||||
$rrd_options .= ' GPRINT:cuptime:AVERAGE:%6.2lf';
|
||||
$rrd_options .= ' GPRINT:cuptime:MAX:%6.2lf';
|
||||
$rrd_options .= " GPRINT:cuptime:AVERAGE:%6.2lf\\n";
|
Reference in New Issue
Block a user