Page 1 of 1

PHP: Serverstatus & Serverofflinemail to Admin

PostPosted: Tue May 07, 2013 7:38 am
by Wahooka
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

Re: PHP: Serverstatus & Serverofflinemail to Admin

PostPosted: Tue May 07, 2013 8:34 am
by Shadexx
Danke!

Re: PHP: Serverstatus & Serverofflinemail to Admin

PostPosted: Thu May 09, 2013 7:40 am
by Graveen
TY !