23 |
|
} |
24 |
|
|
25 |
|
function printAlert($machine, $alert) { |
26 |
+ |
|
27 |
+ |
include("alerts_config.inc.php"); |
28 |
+ |
|
29 |
|
$alertLevel = getValue("alertLevel", $alert); |
30 |
|
$lastAlert = getValue("lastAlert", $alert); |
31 |
|
$thresholdLevel = getValue("thresholdLevel", $alert); |
35 |
|
$attributeName = getValue("attributeName", $alert); |
36 |
|
$timeTillNextAlert = getValue("timeTillNextAlert", $alert); |
37 |
|
$initialAlertTime = getValue("initialAlertTime", $alert); |
38 |
< |
echo "<b>$alertLevel</b>$alert<br>"; |
38 |
> |
|
39 |
> |
$alertColour = $alertLevelColours[$alertLevel]; |
40 |
> |
$alertLevel = $alertLevelNames[$alertLevel]; |
41 |
> |
|
42 |
> |
echo <<<EOT |
43 |
> |
|
44 |
> |
<table border="0"> |
45 |
> |
<tr> |
46 |
> |
<td><b>$attributeName</b></td> |
47 |
> |
<td> </td> |
48 |
> |
<td>Alert level:</td> |
49 |
> |
<td><font color="$alertColour"><b>$alertLevel</b></font></td> |
50 |
> |
</tr> |
51 |
> |
<tr> |
52 |
> |
<td>Threshold:</td> |
53 |
> |
<td>$thresholdValue</td> |
54 |
> |
<td>Initially raised:</td> |
55 |
> |
<td>$initialAlertTime</td> |
56 |
> |
</tr> |
57 |
> |
<tr> |
58 |
> |
<td>Alert value:</td> |
59 |
> |
<td><b>$value</b></td> |
60 |
> |
<td><!--Next alert time:--> </td> |
61 |
> |
<td><!--$timeTillNextAlert--> </td> |
62 |
> |
</tr> |
63 |
> |
</table> |
64 |
> |
|
65 |
> |
EOT; |
66 |
> |
|
67 |
> |
printLine(""); |
68 |
> |
|
69 |
|
} |
70 |
|
|
71 |
+ |
function printReports($machine) { |
72 |
+ |
# Get a list of all files in the machine's directory. |
73 |
+ |
include("alerts_config.inc.php"); |
74 |
+ |
$alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); |
75 |
+ |
|
76 |
+ |
foreach($alertArray as $file_name) { |
77 |
+ |
$input = file("$alertDirectory/$machine/$file_name"); |
78 |
+ |
$input = $input[0]; |
79 |
+ |
$alerts[] = $input; |
80 |
+ |
} |
81 |
+ |
|
82 |
+ |
foreach ($alerts as $alert) { |
83 |
+ |
printAlert($machine, $alert); |
84 |
+ |
} |
85 |
+ |
} |
86 |
+ |
|
87 |
+ |
|
88 |
|
?> |
89 |
|
|
90 |
|
<? include($titleHTML); ?> |
115 |
|
|
116 |
|
printLine(""); |
117 |
|
|
118 |
< |
# Get a list of all files in the machine's directory. |
69 |
< |
$alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); |
118 |
> |
printReports($machine); |
119 |
|
|
71 |
– |
foreach($alertArray as $file_name) { |
72 |
– |
$input = file("$alertDirectory/$machine/$file_name"); |
73 |
– |
$input = $input[0]; |
74 |
– |
$alerts[] = $input; |
75 |
– |
} |
76 |
– |
|
77 |
– |
foreach ($alerts as $alert) { |
78 |
– |
printAlert($machine, $alert); |
79 |
– |
} |
80 |
– |
|
120 |
|
} |
121 |
+ |
else { |
122 |
+ |
printLine(""); |
123 |
+ |
} |
124 |
|
|
125 |
|
?> |
84 |
– |
|
85 |
– |
<? printLine(""); ?> |
126 |
|
|
127 |
|
<? include($bottomHTML); ?> |