Port Scanning and Service Status Checking in PHP
By Akash Mehta2008-06-06
Advanced Status Checking
Now that we've built a basic service status checker, we can easily extend it conduct more rigorous testing, and make better use of the data. Here are some possibilities for extending this script:
- Log service data; it can then be graphed or simply archived for auditing
- Report downtime to you, e.g. via email or SMS
- Conduct service-specific testing, e.g. download a HTML page, run a MySQL query, start an FTP session
I mentioned earlier the importance of hosting your testing script away from your actual server; if your project warrants it, storing a testing script on two different servers is great for redundancy, and the two can even work hand in hand to verify if a supposed outage is only region-specific, e.g. a server in the UK might report downtime while a server in the US does not. This can also aid in tracking down the cause of downtime when networks are involved.
Experiment with these techniques, explore additional testing methods and you could be building business-grade status checking systems in no time at all!
Tutorial Pages:
» Introduction
» Service Checking 101
» Our Implementation
» Advanced Status Checking
