| 24 |
|
|
| 25 |
|
function printAlert($machine, $alert, $small="") { |
| 26 |
|
|
| 27 |
+ |
global $fontsize; |
| 28 |
+ |
|
| 29 |
|
include("alerts_config.inc.php"); |
| 30 |
|
|
| 31 |
|
$alertLevelNum = getValue("alertLevel", $alert); |
| 38 |
|
$timeTillNextAlert = getValue("timeTillNextAlert", $alert); |
| 39 |
|
$initialAlertTime = getValue("initialAlertTime", $alert); |
| 40 |
|
|
| 41 |
+ |
if ($thresholdLevel == "1") { |
| 42 |
+ |
$thresholdLevel = "Lower"; |
| 43 |
+ |
} |
| 44 |
+ |
else if ($thresholdLevel == "2") { |
| 45 |
+ |
$thresholdLevel = "Upper"; |
| 46 |
+ |
} |
| 47 |
+ |
else { |
| 48 |
+ |
$thresholdLevel = "Normal"; |
| 49 |
+ |
} |
| 50 |
+ |
|
| 51 |
|
$alertColour = $alertLevelColours[$alertLevelNum]; |
| 52 |
|
$alertLevel = $alertLevelNames[$alertLevelNum]; |
| 53 |
|
$initialAlertTime = strftime("%x %X", intval($initialAlertTime / 1000)); |
| 54 |
|
|
| 55 |
< |
if ($small == "true") { |
| 55 |
> |
if ($small == "on") { |
| 56 |
|
echo <<<EOT |
| 57 |
|
<tr> |
| 58 |
|
<td width="50"> |
| 62 |
|
<img src="level$alertLevelNum.gif" width="41" height="9" border="0" alt="$alertLevel"> |
| 63 |
|
</td> |
| 64 |
|
<td align="left"> |
| 65 |
< |
<font size="3" color="$alertColour"><b>$alertLevel</b></font> |
| 65 |
> |
<font size="$fontsize" color="$alertColour"><b>$alertLevel</b></font> |
| 66 |
|
</td> |
| 67 |
|
<td align="left"> |
| 68 |
< |
<font size="3">$attributeName</font> |
| 68 |
> |
<font size="$fontsize">$attributeName</font> |
| 69 |
|
</td> |
| 70 |
|
<td> |
| 71 |
|
|
| 88 |
|
</tr> |
| 89 |
|
<tr> |
| 90 |
|
<td align="right"><font size="2">Threshold:</font></td> |
| 91 |
< |
<td align="left">$thresholdValue</td> |
| 91 |
> |
<td align="left">$thresholdValue ($thresholdLevel)</td> |
| 92 |
|
</tr> |
| 93 |
|
<tr> |
| 94 |
|
<td align="right"><font size="2">Alert value:</font></td> |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
function printReports($machine, $small="") { |
| 110 |
+ |
global $fontsize; |
| 111 |
+ |
|
| 112 |
|
# Get a list of all files in the machine's directory. |
| 113 |
|
include("alerts_config.inc.php"); |
| 114 |
|
$alertArray = getdirArray("$alertDirectory/$machine", 'rsort'); |
| 115 |
|
|
| 116 |
< |
if ($small == "true") { |
| 116 |
> |
if ($small == "on") { |
| 117 |
|
echo <<<EOT |
| 118 |
< |
<table border="0" cellpadding="2" cellspacing="0"> |
| 118 |
> |
<table border="0" align="center" cellpadding="2" cellspacing="6"> |
| 119 |
|
<tr> |
| 120 |
|
<td colspan="5"> |
| 121 |
< |
<font size="+1"><b>$machine</b></font> |
| 121 |
> |
<font size="$fontsize"><b><a href="alerts.php?machine=$machine" style="color: black; text-decoration: none;">$machine</a></b></font> |
| 122 |
|
</td> |
| 123 |
|
</tr> |
| 124 |
|
EOT; |
| 131 |
|
<td> |
| 132 |
|
<font color="white"> |
| 133 |
|
<b> |
| 134 |
< |
Current alerts for $machine |
| 134 |
> |
Current alerts for <a href="latest.php?machine=$machine" style="color: white">$machine</a> |
| 135 |
|
</b> |
| 136 |
|
<font size="2"> |
| 137 |
|
<br>Sorted by time, latest first. |
| 160 |
|
} |
| 161 |
|
} |
| 162 |
|
else { |
| 163 |
< |
if ($small != "true") { |
| 163 |
> |
if ($small != "on") { |
| 164 |
|
echo "There are currently no alerts held about <b>$machine</b>"; |
| 165 |
|
printLine(""); |
| 166 |
|
} |
| 167 |
|
} |
| 168 |
|
|
| 169 |
< |
if ($small == "true") { |
| 169 |
> |
if ($small == "on") { |
| 170 |
|
echo "</table>"; |
| 171 |
|
} |
| 172 |
|
else { |
| 183 |
|
|
| 184 |
|
<? include($titleHTML); ?> |
| 185 |
|
|
| 186 |
< |
<? if (!$hideform) { ?> |
| 186 |
> |
<? if ($hideform != "on") { ?> |
| 187 |
|
|
| 188 |
|
<? printLine("Latest alerts for hosts"); ?> |
| 189 |
|
|