add application/apache graph types

git-svn-id: http://www.observium.org/svn/observer/trunk@1476 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-25 18:26:31 +00:00
parent b37c7c87ba
commit cdc17c5226
4 changed files with 155 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
include("includes/graphs/common.inc.php");
$query = mysql_query("SELECT * FROM `applications` AS A, `devices` AS D WHERE A.app_id = '".mres($_GET['id'])."'
AND A.device_id = D.device_id");
$app = mysql_fetch_array($query);
$apache_rrd = $config['rrd_dir'] . "/" . $app['hostname'] . "/app-apache-".$app['app_id'].".rrd";
if(is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$rra = "kbyte";
$colour_area = "CDEB8B";
$colour_line = "006600";
$colour_area_max = "FFEE99";
$graph_max = 1;
$unit_text = "KByte/sec";
include("includes/graphs/generic_simplex.inc.php");
?>

View File

@@ -0,0 +1,29 @@
<?php
include("includes/graphs/common.inc.php");
$query = mysql_query("SELECT * FROM `applications` AS A, `devices` AS D WHERE A.app_id = '".mres($_GET['id'])."'
AND A.device_id = D.device_id");
$app = mysql_fetch_array($query);
$apache_rrd = $config['rrd_dir'] . "/" . $app['hostname'] . "/app-apache-".$app['app_id'].".rrd";
if(is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$rra = "cpu";
$colour_area = "AA66AA";
$colour_line = "FFDD88";
$colour_area_max = "FFEE99";
$graph_max = 1;
$unit_text = "% Used";
include("includes/graphs/generic_simplex.inc.php");
?>

View File

@@ -0,0 +1,29 @@
<?php
include("includes/graphs/common.inc.php");
$query = mysql_query("SELECT * FROM `applications` AS A, `devices` AS D WHERE A.app_id = '".mres($_GET['id'])."'
AND A.device_id = D.device_id");
$app = mysql_fetch_array($query);
$apache_rrd = $config['rrd_dir'] . "/" . $app['hostname'] . "/app-apache-".$app['app_id'].".rrd";
if(is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$rra = "access";
$colour_area = "AA66AA";
$colour_line = "FFDD88";
$colour_area_max = "FFEE99";
$graph_max = 1;
$unit_text = "Hits/sec";
include("includes/graphs/generic_simplex.inc.php");
?>

View File

@@ -0,0 +1,68 @@
<?php
include("includes/graphs/common.inc.php");
$query = mysql_query("SELECT * FROM `applications` AS A, `devices` AS D WHERE A.app_id = '".mres($_GET['id'])."'
AND A.device_id = D.device_id");
$app = mysql_fetch_array($query);
$apache_rrd = $config['rrd_dir'] . "/" . $app['hostname'] . "/app-apache-".$app['app_id'].".rrd";
if(is_file($apache_rrd)) {
$rrd_filename = $apache_rrd;
}
$rrd_options .= ' DEF:a='.$rrd_filename.':sb_wait:AVERAGE ';
$rrd_options .= 'DEF:b='.$rrd_filename.':sb_start:AVERAGE ';
$rrd_options .= 'DEF:c='.$rrd_filename.':sb_reading:AVERAGE ';
$rrd_options .= 'DEF:d='.$rrd_filename.':sb_writing:AVERAGE ';
$rrd_options .= 'DEF:e='.$rrd_filename.':sb_keepalive:AVERAGE ';
$rrd_options .= 'DEF:f='.$rrd_filename.':sb_dns:AVERAGE ';
$rrd_options .= 'DEF:g='.$rrd_filename.':sb_closing:AVERAGE ';
$rrd_options .= 'DEF:h='.$rrd_filename.':sb_logging:AVERAGE ';
$rrd_options .= 'DEF:i='.$rrd_filename.':sb_graceful:AVERAGE ';
$rrd_options .= 'DEF:j='.$rrd_filename.':sb_idle:AVERAGE ';
$rrd_options .= 'COMMENT:"Scoreboard Current Average Maximum" ';
$rrd_options .= 'AREA:a#4444FFFF:"Waiting " ';
$rrd_options .= 'GPRINT:a:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:a:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:a:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:b#FF0000FF:"Keepalive ":STACK ';
$rrd_options .= 'GPRINT:b:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:b:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:b:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:c#750F7DFF:"Reading ":STACK ';
$rrd_options .= 'GPRINT:c:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:c:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:c:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:d#00FF00FF:"Sending ":STACK ';
$rrd_options .= 'GPRINT:d:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:d:AVERAGE":%6.2lf %s" ';
$rrd_options .= 'GPRINT:d:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:e#157419FF:"Starting ":STACK ';
$rrd_options .= 'GPRINT:e:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:e:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:e:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:f#6DC8FEFF:"DNS Lookup":STACK ';
$rrd_options .= 'GPRINT:f:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:f:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:f:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:g#FFAB00FF:"Closing ":STACK ';
$rrd_options .= 'GPRINT:g:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:g:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:g:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:h#FFFF00FF:"Logging ":STACK ';
$rrd_options .= 'GPRINT:h:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:h:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:h:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:i#FF5576FF:"Graceful ":STACK ';
$rrd_options .= 'GPRINT:i:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:i:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:i:MAX:"%6.2lf %s\n" ';
$rrd_options .= 'AREA:j#FF4105FF:"Idle ":STACK ';
$rrd_options .= 'GPRINT:j:LAST:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:j:AVERAGE:"%6.2lf %s" ';
$rrd_options .= 'GPRINT:j:MAX:"%6.2lf %s\n"';
?>