Syntactic Confectionery Delight | |
PerlMonks |
Re: How to check if a website is up?by blue_cowdawg (Monsignor) |
on Apr 05, 2004 at 16:11 UTC ( [id://342657]=note: print w/replies, xml ) | Need Help?? |
Besides all of the suggestions where LWP::Simple are implemented you can also take a sniglet out of one of my scripts. This won't check the content itself but will check to see if the server in question is serving pages at all: You would invoke it as in the following example:
If you want to check the content itself to make sure it hasn't been hacked or otherwise horribly modified then you might want to use LWP::Simple and friends runnng it one time when you know that A) the site is up and B) the page itelf is intact, generate an MD5 sum or some other fingerprint of your choosing and store that someplace for later comparison. The sniglet above comes out of a very old script that I deployed a long time ago and it runs against several sites that I have interest in (clubs I belong to, my own web site, former customers of mine, etc.) and pages me if the site is unreachable so I can make the proper notifications. I plan on overhauling it though given I have learned many better ways of doing things that the script does now which is why it hasn't been posted here in its entirety.
In Section
Seekers of Perl Wisdom
|
|