tmp/server.php

82 lines
2.2 KiB
PHP
Raw Normal View History

2019-01-12 21:36:39 +00:00
<?php include 'HEADER.php'; ?>
2019-01-25 17:19:56 +00:00
<title>Status of thunix Servers and Services - thunix Community</title>
2019-01-12 21:36:39 +00:00
</head>
<body>
<div id="top">
<div id="header">
<div id="logo">
<h1>&#9763; thunix</h1>
</div>
</div>
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="content">
<div class="post">
<h2 class="title">Information and Service Announcements</h2>
<div style="clear: both;">&nbsp;</div>
<div class="entry">
<p>(Coming soon)</p>
</div>
</div>
<div class="post">
<h2 class="title">Server Status</h2>
<div style="clear: both;">&nbsp;</div>
<div class="entry">
<p>
<!-- Have to clean this section up a bit, styling, really -->
<?php
$hosts="all";
$f = fopen("./report", "r");
2019-02-06 14:22:36 +00:00
echo "Last update: " . date ("H:i", filemtime('./report'))."<p>\n";
echo "<table>";
2019-02-06 14:24:33 +00:00
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>";
}
}
}
2019-02-06 16:13:49 +00:00
echo "</tr>\n";
}
2019-02-06 16:13:49 +00:00
echo "\n</table>\n";
fclose($f);
?>
2019-02-06 16:13:49 +00:00
<!-- End of the monitoring script portion -->
</p>
2019-01-12 21:36:39 +00:00
</div>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<?php include 'MENU.php'; ?>
2019-01-25 17:19:56 +00:00
<?php include 'FOOTER.php'; ?>