1 |
tdb |
1.1 |
<?php |
2 |
|
|
|
3 |
|
|
# Navigation for the i-scream reports. |
4 |
|
|
# pjm2@ukc.ac.uk |
5 |
|
|
# |
6 |
|
|
# CONFIGURABLE CONSTANTS: - |
7 |
|
|
|
8 |
|
|
include("browser2_config.inc.php"); |
9 |
|
|
|
10 |
|
|
# |
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 |
|
|
|
26 |
|
|
include("iutils.inc.php"); |
27 |
|
|
|
28 |
|
|
?> |
29 |
|
|
|
30 |
|
|
<? include($titleHTML); ?> |
31 |
|
|
|
32 |
|
|
<hr weight="1" color="<? echo $lineColor ?>"> |
33 |
|
|
|
34 |
|
|
<b>Graphs available for these machines:</b> |
35 |
|
|
|
36 |
|
|
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
37 |
|
|
<select size="1" name="machine_name"> |
38 |
|
|
<? if ($machine_name) { ?> |
39 |
|
|
<option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option> |
40 |
|
|
<option value="">----------------</option> |
41 |
|
|
<? } else { ?> |
42 |
|
|
<option selected value="">[select machine]</option> |
43 |
|
|
<? } ?> |
44 |
|
|
<? |
45 |
|
|
$file_array = getdirArray($rrddir,'asort'); |
46 |
|
|
foreach($file_array as $file_name) { |
47 |
|
|
if(is_dir("$rrddir/$file_name")) { ?> |
48 |
|
|
<option value="<? echo $file_name ?>"><? echo $file_name ?></option> |
49 |
|
|
<? } |
50 |
|
|
} |
51 |
|
|
?> |
52 |
|
|
</select> |
53 |
|
|
|
54 |
|
|
<input type="submit" name="submit" value="Go"> |
55 |
|
|
</form> |
56 |
|
|
|
57 |
|
|
<hr weight="1" color="<? echo $lineColor ?>"> |
58 |
|
|
|
59 |
|
|
<? if ($machine_name) { ?> |
60 |
|
|
|
61 |
|
|
<b>Available graphs for <? echo $machine_name ?></b> |
62 |
|
|
|
63 |
|
|
<form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>"> |
64 |
|
|
<select size="1" name="graph"> |
65 |
|
|
<? if ($report) { ?> |
66 |
|
|
<option selected value="<? echo $report ?>"><? echo $report ?></option> |
67 |
|
|
<option value="">----------------</option> |
68 |
|
|
<? } else { ?> |
69 |
|
|
<option selected value="">[select report]</option> |
70 |
|
|
<? } ?> |
71 |
|
|
<? |
72 |
|
|
$file_array = getdirArray("$rrddir/$machine_name",'asort'); |
73 |
|
|
foreach($file_array as $file_name) { |
74 |
|
|
if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?> |
75 |
|
|
<option value="<? echo $matches[1] ?>"><? echo $matches[1] ?></option> |
76 |
|
|
<? } |
77 |
|
|
} |
78 |
|
|
?> |
79 |
|
|
</select> |
80 |
|
|
|
81 |
|
|
<input type="hidden" name="machine_name" value="<? echo $machine_name ?>"> |
82 |
|
|
<input type="submit" name="submit" value="Show"> |
83 |
|
|
</form> |
84 |
|
|
|
85 |
|
|
<hr weight="1" color="<? echo $lineColor ?>"> |
86 |
|
|
|
87 |
|
|
<? } ?> |
88 |
|
|
|
89 |
|
|
</p> |
90 |
|
|
|
91 |
|
|
|
92 |
|
|
<? |
93 |
|
|
if ($submit == "Show" && $machine_name && $graph) { |
94 |
|
|
|
95 |
|
|
?> |
96 |
|
|
<center><b>[<? echo $machine_name; ?>] - <? echo $graph ?> graphs</b></center> |
97 |
|
|
|
98 |
|
|
<center> |
99 |
|
|
<p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-3h.png" ?>"></p> |
100 |
|
|
<p><b>Last day :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1d.png" ?>"></p> |
101 |
|
|
<p><b>Last week :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1w.png" ?>"></p> |
102 |
|
|
<p><b>Last month :</b><br><img border="0" src="<? echo "$rrdwebdir/$machine_name/$graph-1m.png" ?>"></p> |
103 |
|
|
</center> |
104 |
|
|
|
105 |
|
|
<hr weight="1" color="<? echo $lineColor ?>"> |
106 |
|
|
|
107 |
|
|
<b>Latest data</b> |
108 |
|
|
<p> |
109 |
|
|
Latest set of data received from |
110 |
|
|
<a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a> |
111 |
|
|
<br> |
112 |
|
|
Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a> |
113 |
|
|
|
114 |
|
|
|
115 |
|
|
<hr weight="1" color="<? echo $lineColor ?>"> |
116 |
|
|
<? } |
117 |
|
|
|
118 |
|
|
?> |
119 |
|
|
|
120 |
|
|
<? include($bottomHTML); ?> |