PHP: Serverstatus & Serverofflinemail to Admin

Share files with other Dawn of Light users

Moderator: Support Team

PHP: Serverstatus & Serverofflinemail to Admin

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
User avatar
Wahooka
DOL Visitor
 
Posts: 5
Joined: Fri Oct 01, 2010 9:51 pm
ICQ: 247999491
Website: http://heiko-schoenefeld.de
Location: Germany

Re: PHP: Serverstatus & Serverofflinemail to Admin

Postby Shadexx » Tue May 07, 2013 8:34 am

Danke!
User avatar
Shadexx
DOL Experienced
 
Posts: 156
Joined: Mon Nov 09, 2009 9:58 am
Location: Germany

Re: PHP: Serverstatus & Serverofflinemail to Admin

Postby Graveen » Thu May 09, 2013 7:40 am

TY !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” User Files

Who is online

Users browsing this forum: No registered users and 1 guest