add NTP client/server application poller. fix powerdns_latency graphtype. from Dennis de Houx.

git-svn-id: http://www.observium.org/svn/observer/trunk@2612 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-30 00:19:48 +00:00
parent d8b906051d
commit 2323544d25
17 changed files with 508 additions and 3 deletions
@@ -0,0 +1,20 @@
<?php
include("includes/graphs/common.inc.php");
$scale_min = 0;
$ds = "frequency";
$colour_area = "F6F6F6";
$colour_line = "B3D0DB";
$colour_area_max = "FFEE99";
$graph_max = 100;
$unit_text = "Frequency";
$ntpclient_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
if (is_file($ntpclient_rrd)) {
$rrd_filename = $ntpclient_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
@@ -0,0 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
$colours = "mixed";
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Milliseconds";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpclient-".$app['app_id'].".rrd";
$array = array(
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability')
);
$i = 0;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo("file missing: $file");
}
include("includes/graphs/generic_multi_line.inc.php");
?>
@@ -0,0 +1,33 @@
<?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";
$colour_area_out = "FFDD88";
$colour_area_in_max = "CC88CC";
$colour_area_out_max= "FFEFAA";
$ntpdserver_rrd = $config['rrd_dir'] . "/". $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
// include("includes/graphs/generic_bits.inc.php");
include("includes/graphs/generic_duplex.inc.php");
?>
@@ -0,0 +1,20 @@
<?php
include("includes/graphs/common.inc.php");
$scale_min = 0;
$ds = "frequency";
$colour_area = "F6F6F6";
$colour_line = "B3D0DB";
$colour_area_max = "FFEE99";
$graph_max = 100;
$unit_text = "Frequency";
$ntpdserver_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
@@ -0,0 +1,31 @@
<?php
include("includes/graphs/common.inc.php");
$scale_min = 0;
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Packets";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$array = array(
'packets_drop' => array('descr' => 'Dropped', 'colour' => '880000FF'),
'packets_ignore' => array('descr' => 'Ignored', 'colour' => 'FF8800FF')
);
$i = 0;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $vars['colour'];
$i++;
}
} else {
echo("file missing: $file");
}
// include("includes/graphs/generic_multi_line.inc.php");
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
?>
@@ -0,0 +1,32 @@
<?php
include("includes/graphs/common.inc.php");
$colours = "mixed";
$nototal = (($width<224) ? 1 : 0);
$unit_text = "Milliseconds";
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
$array = array(
'offset' => array('descr' => 'Offset'),
'jitter' => array('descr' => 'Jitter'),
'noise' => array('descr' => 'Noise'),
'stability' => array('descr' => 'Stability')
);
$i = 0;
if (is_file($rrd_filename)) {
foreach ($array as $ds => $vars) {
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $vars['descr'];
$rrd_list[$i]['ds'] = $ds;
$rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
$i++;
}
} else {
echo("file missing: $file");
}
include("includes/graphs/generic_multi_line.inc.php");
?>
@@ -0,0 +1,20 @@
<?php
include("includes/graphs/common.inc.php");
$scale_min = 0;
$ds = "stratum";
$colour_area = "FFCECE";
$colour_line = "880000";
$colour_area_max = "FFCCCC";
$graph_max = 0;
$unit_text = "Stratum";
$ntpdserver_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
include("includes/graphs/generic_simplex.inc.php");
?>
@@ -0,0 +1,36 @@
<?php
include("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 = $config['rrd_dir'] . "/" . $device['hostname'] . "/app-ntpdserver-".$app['app_id'].".rrd";
if (is_file($ntpdserver_rrd)) {
$rrd_filename = $ntpdserver_rrd;
}
include("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";
?>
@@ -4,8 +4,8 @@
$scale_min = 0;
$ds = "latency";
$colour_area = "6699FF";
$colour_line = "336699";
$colour_area = "F6F6F6";
$colour_line = "B3D0DB";
$colour_area_max = "FFEE99";
$graph_max = 100;
$unit_text = "Latency";
+1
View File
@@ -181,6 +181,7 @@ print_optionbar_end();
<b>Jonathan De Graeve</b> SNMP code improvements. <br />
<b>Xiaochi Jin</b> Logo design. <br />
<b>Bruno Pramont</b> Collectd code. <br />
<b>Dennis de Houx</b> Application monitors for PowerDNS, Shoutcast, NTPD (Client, Server). <br />
</div>
</div>
+21
View File
@@ -0,0 +1,21 @@
<?php
global $config;
$graphs = array('ntpclient_stats' => 'NTP Client - Statistics',
'ntpclient_freq' => 'NTP Client - Frequency');
foreach ($graphs as $key => $text) {
$graph_type = $key;
$graph_array['height'] = "100";
$graph_array['width'] = "215";
$graph_array['to'] = $now;
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = "application_".$key;
echo('<h3>'.$text.'</h3>');
echo("<tr bgcolor='$row_colour'><td colspan=5>");
include("includes/print-quadgraphs.inc.php");
echo("</td></tr>");
}
?>
@@ -0,0 +1,26 @@
<?php
global $config;
$graphs = array('ntpdserver_stats' => 'NTPD Server - Statistics',
'ntpdserver_freq' => 'NTPD Server - Frequency',
'ntpdserver_stratum' => 'NTPD Server - Stratum',
'ntpdserver_buffer' => 'NTPD Server - Buffer',
'ntpdserver_bits' => 'NTPD Server - Packets Sent/Received',
'ntpdserver_packets' => 'NTPD Server - Packets Dropped/Ignored',
'ntpdserver_uptime' => 'NTPD Server - Uptime');
foreach ($graphs as $key => $text) {
$graph_type = $key;
$graph_array['height'] = "100";
$graph_array['width'] = "215";
$graph_array['to'] = $now;
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = "application_".$key;
echo('<h3>'.$text.'</h3>');
echo("<tr bgcolor='$row_colour'><td colspan=5>");
include("includes/print-quadgraphs.inc.php");
echo("</td></tr>");
}
?>