PHP webdeveloper and frontend developer




Simple script to check wether my website or webserver is down

Category : Apache ยท by Sep 13th, 2012

I wrote a small script so my monitoring software can check wether something changes on this page. You could add an email function to the script, that alerts you when something goes down. If this page outputs something other than this, the monitoring software will alert me:

domain-reachable

database-online

page-online

If everything is down on the server it will output this:

domain-unreachable

database-offline

page-offline

 

This is the PHP script. The first check does a socket check on port 80. The second function does a check wether a database connection is possible. And the third check, checks if it can find a string on a webpage.

 

SHARE :

Leave a Reply

Your email address will not be published. Required fields are marked *


s