Merge branch 'monitoring' of thunix/www into master
Looks all good, passed dev
This commit is contained in:
commit
3d8b73fb7a
51
server.php
51
server.php
|
@ -23,7 +23,56 @@
|
|||
<h2 class="title">Server Status</h2>
|
||||
<div style="clear: both;"> </div>
|
||||
<div class="entry">
|
||||
<p>(Coming soon)</p>
|
||||
<p>
|
||||
<!-- Have to clean this section up a bit, styling, really -->
|
||||
<?php
|
||||
|
||||
$hosts="all";
|
||||
|
||||
$f = fopen("./report", "r");
|
||||
|
||||
echo "Last update: " . date ("H:i", filemtime('./report'))."<p>\n";
|
||||
echo "<table style='width:80%'>";
|
||||
echo " <tr>
|
||||
<th>Host</th>
|
||||
<th>Check</th>
|
||||
<th>Status</th>
|
||||
</tr>";
|
||||
while (($line = fgetcsv($f)) !== false) {
|
||||
echo "<tr>";
|
||||
if ($hosts == "failed" ) {
|
||||
if ($line[2] == "FAILED") {
|
||||
foreach ($line as $cell) {
|
||||
if ($cell == "FAILED") {
|
||||
echo '<td style="color:#FF0000">' . htmlspecialchars($cell) . '</td>';
|
||||
}
|
||||
else {
|
||||
echo "<td>" .htmlspecialchars($cell) . "</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($hosts == "all") {
|
||||
foreach ($line as $cell) {
|
||||
if ($cell == "FAILED") {
|
||||
echo '<td style="color:#FF0000">' . htmlspecialchars($cell) . '</td>';
|
||||
}
|
||||
elseif ($cell=="GOOD") {
|
||||
echo '<td style="color:#00FF00">' . htmlspecialchars($cell) . "</td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>" .htmlspecialchars($cell) . "</td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
echo "\n</table>\n";
|
||||
fclose($f);
|
||||
?>
|
||||
<!-- End of the monitoring script portion -->
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"> </div>
|
||||
|
|
Loading…
Reference in New Issue