This is a discussion on Check if a web server is down within the Windows Web Servers forums, part of the Web Server and Related Forums category; Hello all, I'm working on an 'alert' mechanism which would send a mail to the admins if the web ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |