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
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_filename = rrd_name($device['hostname'], array('app', 'nginx', $app['app_id']));
|
2010-10-22 18:14:59 +00:00
|
|
|
|
2016-07-08 15:09:11 -05:00
|
|
|
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
2015-07-10 13:36:21 +02:00
|
|
|
$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'";
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2015-07-10 13:36:21 +02:00
|
|
|
$error_msg = 'Missing RRD';
|
2011-10-07 19:09:35 +00:00
|
|
|
}
|