diff --git a/articles/server.md b/articles/server.md index f9e1da9..bb7417a 100644 --- a/articles/server.md +++ b/articles/server.md @@ -40,18 +40,4 @@ irc.tilde.chat/6697, or via a web chat interface located [here](). Thunix hosts mirrors for several FOSS projects. You can see the full mirror list in the sidebar link. - -# Server Status - -Last update: 18:17 - -| Check | Status| -|---|---| -| sshd | GOOD| -| BZFlag\_Server | GOOD| -| Memory | GOOD| -| Minetest\_Server | GOOD| -| web\_site | GOOD| -| web\_site\_https| GOOD| -| imap | GOOD| -| smtp | GOOD| + diff --git a/includes/report b/includes/report new file mode 100644 index 0000000..7c04250 --- /dev/null +++ b/includes/report @@ -0,0 +1,8 @@ +thunix.net,sshd,GOOD +thunix.net,BZFlag_Server,GOOD +thunix.net,Memory,GOOD +thunix.net,Minetest_Server,GOOD +thunix.net,web_site,GOOD +thunix.net,web_site_https,GOOD +thunix.net,imap,GOOD +thunix.net,smtp,GOOD diff --git a/includes/server.php b/includes/server.php new file mode 100644 index 0000000..34f4eb7 --- /dev/null +++ b/includes/server.php @@ -0,0 +1,133 @@ +setMarkupEscaped(true); +$ParsedownExtra = new ParsedownExtra(); + +if ( $page == "") { + $page = "main"; + } + +if ( $style == "") { + if ( $site_style == "") { + $site_style="site"; + } +} +else { + $site_style=$style; +} + +$header = file_get_contents("$doc_root/includes/header.md"); +$sidebar = file_get_contents("$doc_root/includes/sidebar.md"); +$content = file_get_contents("$doc_root/articles/server.md"); +$footer = file_get_contents("$doc_root/includes/footer.md"); + +print " + + + $site_name - $page + + + + + + + +"; + +print "
+
+ + + + + + +
"; + +echo $ParsedownExtra->text($content); + +// Monitoring section + +$hosts="all"; + +$f = fopen("./report", "r"); + +echo "Last update: " . date ("H:i", filemtime('./report'))."

\n"; +echo ""; +echo " + + + + "; +while (($line = fgetcsv($f)) !== false) { + echo ""; + if ($hosts == "failed" ) { + if ($line[2] == "FAILED") { + foreach ($line as $cell) { + if ($cell == "FAILED") { + echo ''; + } + else { + echo ""; + } + } + } + } + elseif ($hosts == "all") { + foreach ($line as $cell) { + if ($cell == "FAILED") { + echo ''; + } + elseif ($cell=="GOOD") { + echo '"; + } + else { + echo ""; + } + } + } + echo "\n"; +} +echo "\n
HostCheckStatus
' . htmlspecialchars($cell) . '" .htmlspecialchars($cell) . "' . htmlspecialchars($cell) . '' . htmlspecialchars($cell) . "" .htmlspecialchars($cell) . "
\n"; +fclose($f); + +// End monitoring section +print "

+ + +
+ + + + + + +"; +?>