ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/php/graphs/graphs.php
Revision: 1.2
Committed: Sat May 18 18:15:57 2002 UTC (22 years, 6 months ago) by tdb
Branch: MAIN
Changes since 1.1: +19 -0 lines
Log Message:
i-scream is now licensed under the GPL. I've added the GPL headers to every
source file, and put a full copy of the license in the appropriate places.
I think I've covered everything. This is going to be a mad commit ;)

File Contents

# Content
1 <?php
2
3 #
4 # i-scream central monitoring system
5 # Copyright (C) 2000-2002 i-scream
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # as published by the Free Software Foundation; either version 2
10 # of the License, or (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #
21
22 # Navigation for the i-scream graphs
23 # tim@i-scream.org.uk
24 #
25 # CONFIGURABLE CONSTANTS: -
26
27 include("graphs_config.inc.php");
28
29 #
30 # END CONFIGURATION
31
32
33 include("iutils.inc.php");
34
35 ?>
36
37 <? include($titleHTML); ?>
38
39 <hr weight="1" color="<? echo $lineColor ?>">
40
41 <b>Graphs available for these machines:</b>
42
43 <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
44 <select size="1" name="machine_name">
45 <? if ($machine_name) { ?>
46 <option selected value="<? echo $machine_name ?>"><? echo $machine_name ?></option>
47 <option value="">----------------</option>
48 <? } else { ?>
49 <option selected value="">[select machine]</option>
50 <? } ?>
51 <?
52 $file_array = getdirArray($imgdir,'asort');
53 foreach($file_array as $file_name) {
54 if(is_dir("$imgdir/$file_name")) { ?>
55 <option value="<? echo $file_name ?>"><? echo $file_name ?></option>
56 <? }
57 }
58 ?>
59 </select>
60
61 <input type="submit" name="submit" value="Go">
62 </form>
63
64 <hr weight="1" color="<? echo $lineColor ?>">
65
66 <? if ($machine_name) { ?>
67
68 <b>Available graphs for <? echo $machine_name ?></b>
69
70 <form method="<? echo $formMethod ?>" action="<? echo $thisPage ?>">
71 <select size="1" name="graph">
72 <? if ($graph) { ?>
73 <option selected value="<? echo $graph ?>"><? echo tidyName($machine_name, $graph) ?></option>
74 <option value="">----------------</option>
75 <? } else { ?>
76 <option selected value="">[select graph]</option>
77 <? } ?>
78 <?
79 $file_array = getdirArray("$imgdir/$machine_name",'asort');
80 foreach($file_array as $file_name) {
81 if(preg_match("/^(\S+)\-3h.png$/", $file_name, $matches)) { ?>
82 <option value="<? echo $matches[1] ?>"><? echo tidyName($machine_name, $matches[1]) ?></option>
83 <? }
84 }
85 ?>
86 </select>
87
88 <input type="hidden" name="machine_name" value="<? echo $machine_name ?>">
89 <input type="submit" name="submit" value="Show">
90 </form>
91
92 <hr weight="1" color="<? echo $lineColor ?>">
93
94 <? } ?>
95
96 </p>
97
98
99 <?
100 if ($submit == "Show" && $machine_name && $graph) {
101
102 ?>
103 <center><b>[<? echo $machine_name; ?>] - '<? echo tidyName($machine_name, $graph) ?>' graphs</b></center>
104
105 <center>
106 <p><b>Last 3 hours :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-3h.png" ?>"></p>
107 <p><b>Last day :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1d.png" ?>"></p>
108 <p><b>Last week :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1w.png" ?>"></p>
109 <p><b>Last month :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1m.png" ?>"></p>
110 <p><b>Last year :</b><br><img border="0" src="<? echo "$imgwebdir/$machine_name/$graph-1y.png" ?>"></p>
111 </center>
112
113 <hr weight="1" color="<? echo $lineColor ?>">
114
115 <b>Latest data</b>
116 <p>
117 Latest set of data received from
118 <a href="<? echo "latest.php?machine=$machine_name"; ?>"><?=$machine_name?></a>
119 <br>
120 Alerts for <a href="alerts.php?machine=<?=$machine_name?>"><?=$machine_name?></a>
121
122
123 <hr weight="1" color="<? echo $lineColor ?>">
124 <? }
125
126 ?>
127
128 <? include($bottomHTML); ?>