We use a perl script to monitor our webservers, and if any are down, send an email (SMS) to the right people.
With thanks and compliments to these guys
Here is the perl script, monitor-website.pl
#!/usr/bin/perl
use Getopt::Std;
# Define the address the alerts should come from
$monitor_email = "Website_Monitor";
# Define global variables
$curl_executable = "/usr/bin/curl";
$mail_executable = "/usr/sbin/sendmail";
$OPT_STRING = 'hs:e:';
# Start program
&main();
sub main {
# Read in the options
getopts( "$OPT_STRING", \%opt ) or usage();
# Set variables
my $url_header = "";
my $url_body = "";
my $email_address = "";
my $url = $ARGV[0];
my $valid_string = "