Postby Wahooka » Tue May 07, 2013 7:38 am
HeyDyHo,
I wanted a script that outputs the server status, unfortunately, I found no working script and made it myself.
An email is sent to the admin, should the server go offline. In the version of the script (below) you get a E-Mail when anyone load the Script-Page. Alternatively, you can set it up as a cron job.
<?
$fp = @fsockopen("tcp://SERVERIP", 10300, $errno, $errstr, 1);
if (!$fp)
{
HERE YOU CAN ADD ANY OPTIONS WHEN THE SERVER IS OFFLINE. Like: echo "Server is Offline!";
mail("INSERT E-MAIL ADRESS HERE", "E-MAIL TOPIC", "E-MAIL MESSAGE");
}
else {
HERE YOU CAN ADD ANY OPTIONS WHEN THE SERVER IS ONLINE. Like: echo "Server is Online!";
}
?>
bb