Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Automated server heartbeat and health check

Occasionally - very occasionally - we may have a problem on our public facing web server that's hosted in some network operation centre or other. It could be a software glitch, or it could be an internet connectivity issue. And we need to know about it quickly!

The problem is than none of us might actually be using the server. I could be giving a private course in Kent, Lisa may be in the office confirming a public course booking, and Chris could be at home in Calne. We have some excellent customers who have been known to alert us by email (thanks, customer Chris, the other day!) but really it should not be necessary for that - in fact, we should find the problem before it gets widely noticed.

I had a bit of a rant the other day about someone who's running a script that pulls a page off our site every five minutes to see if we're still running (see here) but it also set me thinking that we could monitor our own server in a similar way - it's a very different matter to monitor yourself that to monitor someone else uninvited, after all! And we do have a second (backup) server.

So ... here's what we are now doing:

a) I have installed a PHP program that runs stand alone on our backup server which checks with our main server and emails all three of us "techies" if the main server does not respond. (source code)

b) We have a regular times (crontab) job running 4 times an hour ... running this program. The crontab line is in the source code as a comment / example

And it can be that easy!

I have chosen to go one stage further - the page I am calling up on the public server is actually a status line generator, so that our backup server can do more that just say "live" or "dead" - it can also say "live but looking a bit sick" if it needs to. The status script is actually called up from within my Ajax Demonstation too, and you can see the source code here if you wish.

((As an extra, I should have our main server heartbeating our backup server in an equal and opposite arrangement so that we'll be notified if either one falls over))
(written 2009-01-16 07:49:14)

 
Associated topics are indexed under
H307 - PHP - Web2 and caching
  [2545] Scraping content for your own page via PHP - (2009-12-21)
  [2321] Uploading and Downloading files - changing names (Perl and PHP) - (2009-08-04)
  [2196] New Example - cacheing results in PHP for faster loading - (2009-05-24)
  [1926] Flash (client) to PHP (server) - example - (2008-12-06)
  [1814] Javascript/HTML example, dynamic server monitor - (2008-09-28)
  [1813] Ajax - going Asyncronous and what it means - (2008-09-28)
  [1812] Starting Ajax - easy example of browser calling up server data - (2008-09-27)
  [1733] memcached - overview, installation, example of use in PHP - (2008-08-02)
  [1647] Exchange Rates - PHP with your prices in your users currency - (2008-05-19)
  [1633] Changing a screen saver from a web page (PHP, Perl, OSX) - (2008-05-06)

A690 - Web Application Deployment - Clustering and load balancing
  [2483] Clustering on Tomcat - (2009-10-30)
  [2482] Load balancing with sticky sessions (httpd / Tomcat) - (2009-10-29)
  [2059] Sharing the load between servers - httpd and Tomcat - (2009-02-28)
  [1993] Load Balancing - Hardware or Software? - (2009-01-15)
  [1771] More HowTo diagrams - MySQL, Tomcat and Java - (2008-08-24)
  [1121] Sharing the load with Apache httpd and perhaps Tomcat - (2007-03-29)
  [934] Clustering, load balancing, mod_rewrite and mod_proxy - (2006-11-21)


Back to
tomcat-users.xml; what a difference a space made
Previous and next
or
Horse's mouth home
Forward to
Advise before my Apache / Tomcat course
Some other Articles
How low can you sink?
Text on a background image
Travelling to a course - station pickups
Advise before my Apache / Tomcat course
Automated server heartbeat and health check
tomcat-users.xml; what a difference a space made
A good time to travel
Rules for a King
Speaking all the languages
2618 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho