| 1 |
|
<?php |
| 2 |
|
|
| 3 |
< |
# Navigation for the i-scream reports. |
| 4 |
< |
# pjm2@ukc.ac.uk |
| 3 |
> |
# Navigation for the i-scream graphs |
| 4 |
> |
# tim@i-scream.org.uk |
| 5 |
|
# |
| 6 |
|
# CONFIGURABLE CONSTANTS: - |
| 7 |
|
|
| 11 |
|
# END CONFIGURATION |
| 12 |
|
|
| 13 |
|
|
| 14 |
– |
|
| 15 |
– |
|
| 16 |
– |
|
| 17 |
– |
# Used to return whether or not a report data file is empty. |
| 18 |
– |
function isReportEmpty($filename, $minFileSize) { |
| 19 |
– |
if (filesize($filename) < $minFileSize) { |
| 20 |
– |
return TRUE; |
| 21 |
– |
} |
| 22 |
– |
return FALSE; |
| 23 |
– |
} |
| 24 |
– |
|
| 25 |
– |
|
| 14 |
|
include("iutils.inc.php"); |
| 15 |
|
|
| 16 |
|
?> |
| 30 |
|
<option selected value="">[select machine]</option> |
| 31 |
|
<? } ?> |
| 32 |
|
<? |
| 33 |
< |
$file_array = getdirArray($rrddir,'asort'); |
| 33 |
> |
$file_array = getdirArray($imgdir,'asort'); |
| 34 |
|
foreach($file_array as $file_name) { |
| 35 |
< |
if(is_dir("$rrddir/$file_name")) { ?> |
| 35 |
> |
if(is_dir("$imgdir/$file_name")) { ?> |
| 36 |
|
<option value="<? echo $file_name ?>"><? echo $file_name ?></option> |
| 37 |
|
<? } |
| 38 |
|
} |
| 50 |
|
|
| 51 |
|
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
| 52 |
|
<select size="1" name="graph"> |
| 53 |
< |
<? if ($report) { ?> |
| 54 |
< |
<option selected value="<? echo $report ?>"><? echo $report ?></option> |
| 53 |
> |
<? if ($graph) { ?> |
| 54 |
> |
<option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option> |
| 55 |
|
<option value="">----------------</option> |
| 56 |
|
<? } else { ?> |
| 57 |
< |
<option selected value="">[select report]</option> |
| 57 |
> |
<option selected value="">[select graph]</option> |
| 58 |
|
<? } ?> |
| 59 |
|
<? |
| 60 |
< |
$file_array = getdirArray("$rrddir/$machine_name",'asort'); |
| 60 |
> |
$file_array = getdirArray("$imgdir/$machine_name",'asort'); |
| 61 |
|
foreach($file_array as $file_name) { |
| 62 |
|
if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?> |
| 63 |
< |
<option value="<? echo $matches[1] ?>"><? echo $matches[1] ?></option> |
| 63 |
> |
<option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option> |
| 64 |
|
<? } |
| 65 |
|
} |
| 66 |
|
?> |
| 81 |
|
if ($submit == "Show" && $machine_name && $graph) { |
| 82 |
|
|
| 83 |
|
?> |
| 84 |
< |
<center><b>[<? echo $machine_name; ?>] - <? echo $graph ?> graphs</b></center> |
| 84 |
> |
<center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center> |
| 85 |
|
|
| 86 |
|
<center> |
| 87 |
< |
<p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-3h.png" ?>"></p> |
| 88 |
< |
<p><b>Last day :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1d.png" ?>"></p> |
| 89 |
< |
<p><b>Last week :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1w.png" ?>"></p> |
| 90 |
< |
<p><b>Last month :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1m.png" ?>"></p> |
| 87 |
> |
<p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p> |
| 88 |
> |
<p><b>Last day :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p> |
| 89 |
> |
<p><b>Last week :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p> |
| 90 |
> |
<p><b>Last month :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p> |
| 91 |
> |
<p><b>Last year :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p> |
| 92 |
|
</center> |
| 93 |
|
|
| 94 |
|
<hr weight="1" color="<? echo $lineColor ?>"> |