Web Servers General Talk - Check if a web server is down

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers General Talk > March 2004 > Check if a web server is down





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Check if a web server is down
Lax

2004-03-31, 8:33 pm

Hello all,
I'm working on an 'alert' mechanism which would send a mail to the
admins
if the web server is down. I plan to do this in Perl's LWP.

Along these lines,
========================================
==========================
use LWP::Simple ;
my $chkUrl = get("http://abc.xyz.com");
if ( ! $chkUrl )
{
&mail_the_Admins_the_server_is_down() ;
die "Cant connect: Check if the server is down\n" ;
} else { &do_some_prcessing_here() ;
}
========================================
==========================

I expect this piece of code to be used over and over in our services
and want to minimize performance hits that the web server takes on
each check.

Could anyone recommend the best way to check for web server being up
or down without causing major performance issues, please?

Should I use a HEAD request for an URL on the server?
I dont want the script to keep pinging the server.

Thanks for your time,
Lax
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com