--- ../nisca-2.2/report.phtml Tue Feb 26 07:04:19 2002
+++ report.phtml Tue Feb 26 06:40:54 2002
@@ -72,7 +72,7 @@
global $X, $Y, $cnt_stamps, $ttf_font, $bitbyte, $in_out,
$graph_background, $graph_text, $graph_border_light, $graph_border_dark,
$graph_peak_highlight, $graph_incoming_data, $graph_outgoing_data,
- $dateformat, $dformat, $tformat;
+ $dateformat, $dformat, $tformat, $flubber, $map;
$img=imagecreate($X, $Y);
if (eregi("i", $in_out)) { $do_in="y"; } else { unset($do_in); }
@@ -168,18 +168,18 @@
$more_mod=1;
if ($bitbyte=="b" && ($gtype=="bits" || $gtype=="bytes")) { $more_mod=8; }
// If the Y values are greater than 1 gig, show results in gig.
- if ($data_max >= 1024*1024*1024/$more_mod) {
- $modifier = 1024*1024*1024;
+ if ($data_max >= 1000000000/$more_mod) {
+ $modifier = 1000000000;
$mod_disp="G";
}
// If the Y values are greater than 1 meg, show results in meg.
- elseif ($data_max >= 1024*1024/$more_mod) {
- $modifier = 1024*1024;
+ elseif ($data_max >= 1000000/$more_mod) {
+ $modifier = 1000000;
$mod_disp="M";
}
// If the Y values are greater than 1K, show results in K.
- elseif ($data_max >= 1024/$more_mod) {
- $modifier = 1024;
+ elseif ($data_max >= 1000/$more_mod) {
+ $modifier = 1000;
$mod_disp="K";
}
@@ -241,6 +241,7 @@
}
// Draw the X-axis gridlines and labels:
+ $map="\n";
+
$timerange=$stamp_max-$stamp_min;
$xpct = $num_xpixels / $timerange;
$ypct = $yceil * $modifier;
@@ -353,6 +378,15 @@
$errtxt="";
+if ($flubber) {
+// it will contain f_month, etc.
+ $tmp=unserialize(ss(urldecode($flubber)));
+ $flubber=$tmp;
+ foreach(array_keys($flubber) as $k) {
+ $$k=$flubber[$k]; // heheh... tricky.
+ }
+}
+
if ($report == "" && count($hostif) < 1) {
$errtxt .= "You have to pick at least one hostname/interface to do a report on.
\n";
}
@@ -437,13 +471,13 @@
Rather a lot, isn't it? :)
*/
-$graph_background=strtoupper($g_bg);
-$graph_text=strtoupper($g_text);
-$graph_border_light=strtoupper($g_lborder);
-$graph_border_dark=strtoupper($g_dborder);
-$graph_peak_highlight=strtoupper($g_peak);
-$graph_incoming_data=strtoupper($g_in);
-$graph_outgoing_data=strtoupper($g_out);
+if ($g_bg) { $graph_background=strtoupper($g_bg); }
+if ($g_text) { $graph_text=strtoupper($g_text); }
+if ($g_lborder) { $graph_border_light=strtoupper($g_lborder); }
+if ($g_dborder) { $graph_border_dark=strtoupper($g_dborder); }
+if ($g_peak) { $graph_peak_highlight=strtoupper($g_peak); }
+if ($g_in) { $graph_incoming_data=strtoupper($g_in); }
+if ($g_out) { $graph_outgoing_data=strtoupper($g_out); }
if ($rpt_name != "" && $report == "") {
$sq="select id from reports where name='$rpt_name'";
@@ -483,6 +517,18 @@
$random_msgs .= "Generated from saved report \"$rname\".
";
}
+// we have to make this *after* the report options are loaded, if any.
+// f_month, etc will be added by makegraph().
+// $timeperiod will always be "set_dates".
+$flubber=array("hostif"=>$hostif, "bytes"=>$bytes, "packets"=>$packets, "errors"=>$errors,
+ "dropped"=>$dropped, "reportctl"=>$reportctl, "in_out"=>$in_out, "g_fmt"=>$g_fmt,
+ "multiple"=>$multiple, "avginterval"=>$avginterval, "timeperiod"=>"set_dates",
+ "graph_x"=>$graph_x, "graph_y"=>$graph_y, "summ_interval"=>$summ_interval,
+ "summ_units"=>$summ_units, "graph_background"=>$graph_background, "graph_text"=>$graph_text,
+ "graph_border_light"=>$graph_border_light, "graph_border_dark"=>$graph_border_dark,
+ "graph_peak_highlight"=>$graph_peak_highlight, "graph_incoming_data"=>$graph_incoming_data,
+ "graph_outgoing_data"=>$graph_outgoing_data);
+
// Now let's do some report generatin'...
$start_stopwatch=getmicrotime();
@@ -838,7 +884,9 @@
echo "Couldn't create image file "bytes_$xtime.png"... probably write permissions.
\n";
}
}
- echo "
$font2Total average $reptype per second:
\n
$font2Total average $reptype per second:
\n" .
+ "
$font2Average $reptype per second transferred on $hostal->$ifal:
\n
$font2Average $reptype per second transferred on $hostal->$ifal:
\n" .
+ "
$font2Average packets per second transferred on $hostal->$ifal:
\n
$font2Average packets per second transferred on $hostal->$ifal:
\n" .
+ "
$font2Average errors per second on $hostal->$ifal:
\n
$font2Average errors per second on $hostal->$ifal:
\n" .
+ "
$font2Average dropped Packets per second on $hostal->$ifal:
\n
$font2Average dropped Packets per second on $hostal->$ifal:
\n" .
+ "