forked from thunix/www
First round of testing the monitoring table
This commit is contained in:
parent
eeb2a74635
commit
cab3bbad97
45
server.php
45
server.php
|
@ -23,7 +23,50 @@
|
||||||
<h2 class="title">Server Status</h2>
|
<h2 class="title">Server Status</h2>
|
||||||
<div style="clear: both;"> </div>
|
<div style="clear: both;"> </div>
|
||||||
<div class="entry">
|
<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('/tmp/report'))."<p>\n";
|
||||||
|
|
||||||
|
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><p>\n";
|
||||||
|
fclose($f);
|
||||||
|
?>
|
||||||
|
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="clear: both;"> </div>
|
<div style="clear: both;"> </div>
|
||||||
|
|
Loading…
Reference in New Issue