new noagg option to prevent displaying the aggregates

This commit is contained in:
Mickael Marchand
2015-05-10 18:36:15 +02:00
parent 9de24dbe48
commit cdd073a197
2 changed files with 25 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ if ($_GET['inverse']) { $in = 'out'; $out = 'in'; $inverse=TRUE; } else { $in =
if ($_GET['legend'] == "no") { $rrd_options .= " -g"; }
if ($_GET['nototal']) { $nototal=TRUE;} else { $nototal=FALSE;}
if ($_GET['nodetails']) { $nodetails=TRUE; } else { $nodetails=FALSE; }
if ($_GET['noagg']) { $noagg=TRUE; } else { $noagg=FALSE; }
if ($_GET['title'] == "yes") { $rrd_options .= " --title='".$graph_title."' "; }
if (isset($_GET['graph_title'])) { $rrd_options .= " --title='".$_GET['graph_title']."' "; }

View File

@@ -98,29 +98,31 @@ foreach ($rrd_list as $rrd)
$i++; $iter++;
}
$rrd_options .= " CDEF:aggr".$in."bytes=" . $aggr_in.",ADDNAN";
$rrd_options .= " CDEF:aggr".$out."bytes=" . $aggr_out.",ADDNAN";
$rrd_options .= " CDEF:aggrinbits=aggrinbytes,".$multiplier.",*";
$rrd_options .= " CDEF:aggroutbits=aggroutbytes,".$multiplier.",*";
$rrd_options .= " VDEF:totalin=aggrinbytes,TOTAL";
$rrd_options .= " VDEF:totalout=aggroutbytes,TOTAL";
$rrd_options .= " COMMENT:' \\\\n'";
$rrd_options .= " COMMENT:'".substr(str_pad("Aggregate In", $descr_len+5),0,$descr_len+5)."'";
$rrd_options .= " GPRINT:aggrinbits:LAST:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggrinbits:AVERAGE:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggrinbits:MAX:%6.2lf%s$units";
if (!$nototal) {
$rrd_options .= " GPRINT:totalin:%6.2lf%s$total_units";
if (!$noagg){
$rrd_options .= " CDEF:aggr".$in."bytes=" . $aggr_in.",ADDNAN";
$rrd_options .= " CDEF:aggr".$out."bytes=" . $aggr_out.",ADDNAN";
$rrd_options .= " CDEF:aggrinbits=aggrinbytes,".$multiplier.",*";
$rrd_options .= " CDEF:aggroutbits=aggroutbytes,".$multiplier.",*";
$rrd_options .= " VDEF:totalin=aggrinbytes,TOTAL";
$rrd_options .= " VDEF:totalout=aggroutbytes,TOTAL";
$rrd_options .= " COMMENT:' \\\\n'";
$rrd_options .= " COMMENT:'".substr(str_pad("Aggregate In", $descr_len+5),0,$descr_len+5)."'";
$rrd_options .= " GPRINT:aggrinbits:LAST:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggrinbits:AVERAGE:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggrinbits:MAX:%6.2lf%s$units";
if (!$nototal) {
$rrd_options .= " GPRINT:totalin:%6.2lf%s$total_units";
}
$rrd_options .= "\\\\n";
$rrd_options .= " COMMENT:'".substr(str_pad("Aggregate Out", $descr_len+5),0,$descr_len+5)."'";
$rrd_options .= " GPRINT:aggroutbits:LAST:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggroutbits:AVERAGE:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggroutbits:MAX:%6.2lf%s$units";
if (!$nototal) {
$rrd_options .= " GPRINT:totalout:%6.2lf%s$total_units";
}
$rrd_options .= "\\\\n";
}
$rrd_options .= "\\\\n";
$rrd_options .= " COMMENT:'".substr(str_pad("Aggregate Out", $descr_len+5),0,$descr_len+5)."'";
$rrd_options .= " GPRINT:aggroutbits:LAST:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggroutbits:AVERAGE:%6.2lf%s$units";
$rrd_options .= " GPRINT:aggroutbits:MAX:%6.2lf%s$units";
if (!$nototal) {
$rrd_options .= " GPRINT:totalout:%6.2lf%s$total_units";
}
$rrd_options .= "\\\\n";
if ($custom_graph) { $rrd_options .= $custom_graph; }