2010-10-22 18:14:59 +00:00
|
|
|
<?php
|
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
require 'includes/graphs/common.inc.php';
|
2010-10-22 18:14:59 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-nginx-'.$app['app_id'].'.rrd';
|
2010-10-22 18:14:59 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
if (is_file($rrd_filename)) {
|
|
|
|
$rrd_options .= ' -b 1000 ';
|
|
|
|
$rrd_options .= ' -l 0 ';
|
|
|
|
$rrd_options .= ' DEF:a='.$rrd_filename.':Requests:AVERAGE';
|
2010-10-22 18:14:59 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$rrd_options .= " COMMENT:'Requests Current Average Maximum\\n'";
|
2010-10-22 18:14:59 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$rrd_options .= ' AREA:a#98FB98';
|
|
|
|
$rrd_options .= " LINE1.5:a#006400:'Requests '";
|
|
|
|
$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'";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$error_msg = 'Missing RRD';
|
2011-10-07 19:09:35 +00:00
|
|
|
}
|