Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How to check if a website is up?

by chimni (Pilgrim)
on Apr 05, 2004 at 08:27 UTC ( [id://342591]=note: print w/replies, xml ) Need Help??


in reply to How to check if a website is up?

Hi,
You could check out LWP::UserAgent and LWP::Simple.
If you want to extend into monitoring and health checks look at WWW::Mechanize.
use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get( $url );

Just get the page and check for a 200 status (the documentation on these modules is self explanatory)
If you dont want to go with a perl module and want a simple command line solution check WGET.
 wget -q --proxy=off --cache=off $URL -O /tmp/urlget.html
HTH
Regards,
Rajdeep.
Abigail is right,content checking for a string you are expecting is a good idea

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://342591]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-24 06:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found