Files
librenms-librenms/html/includes/graphs/generic_simplex.inc.php
T

47 lines
1.3 KiB
PHP
Raw Normal View History

2009-10-27 13:04:16 +00:00
<?php
/// Draw generic bits graph
/// args: rra_in, rra_out, rrd_filename, bg, legend, from, to, width, height, inverse, $percentile
include("common.inc.php");
2009-10-28 23:34:13 +00:00
$unit_text = str_pad(truncate($unit_text,10),10);
2009-10-27 13:04:16 +00:00
2009-10-28 23:34:13 +00:00
$rrd_options .= " DEF:".$rra."=".$rrd_filename.":".$rra.":AVERAGE";
$rrd_options .= " DEF:".$rra."_max=".$rrd_filename.":".$rra.":MAX";
2009-10-27 13:04:16 +00:00
if($print_total) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " VDEF:".$rra."_total=rra,TOTAL";
2009-10-27 13:04:16 +00:00
}
if($percentile) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " VDEF:".$rra."_percentile=".$rra.",".$percentile.",PERCENT";
2009-10-27 13:04:16 +00:00
}
if($graph_max) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " AREA:".$rra."_max#".$colour_area_max.":";
2009-10-27 13:04:16 +00:00
}
2009-10-28 23:34:13 +00:00
$rrd_options .= " AREA:".$rra."#".$colour_area.":";
$rrd_options .= " COMMENT:'".$unit_text."Now Ave Max";
2009-10-27 13:04:16 +00:00
if($percentile) {
2009-10-28 23:34:13 +00:00
$rrd_options .= "\ \ \ \ \ \ ".$percentile."th\ %";
2009-10-27 13:04:16 +00:00
}
2009-10-28 23:34:13 +00:00
$rrd_options .= "\\n'";
$rrd_options .= " LINE1.25:".$rra."#".$colour_line.":In\ ";
$rrd_options .= " GPRINT:".$rra.":LAST:%6.2lf%s";
$rrd_options .= " GPRINT:".$rra.":AVERAGE:%6.2lf%s";
$rrd_options .= " GPRINT:".$rra."_max:MAX:%6.2lf%s";
2009-10-27 13:04:16 +00:00
if($percentile) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " GPRINT:".$rra."_percentile:%6.2lf%s";
2009-10-27 13:04:16 +00:00
}
$rrd_options .= "\\\\n";
$rrd_options .= " COMMENT:\\\\n";
if($print_total) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " GPRINT:".$rra."_tot:Total\ %6.2lf%s\)\\\\l";
2009-10-27 13:04:16 +00:00
}
if($percentile) {
2009-10-28 23:34:13 +00:00
$rrd_options .= " LINE1:".$rra."_percentile#aa0000";
2009-10-27 13:04:16 +00:00
}
?>