• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

External script to check website health

I have two websites that I'm responsible for. The company that hosts those websites used to provide website monitoring, but that will go away soon.

I'm thinking that I can use a script on a server here at my work that can run every few minutes to check whether the websites respond to an HTTP request, and send an email (or SMS or whatever) if response is above a threshold, or there's no response at all, but I don't really know where to start.

Can someone point me in the right direction?
Thanks in advance for any help provided...
0
thomasedooley
Asked:
thomasedooley
  • 4
  • 3
1 Solution
 
mdlinesCommented:
Hi Thomas
If you can wait about a week I am just writing the very same script for someone else and I could let you have a copy. You can just alter the variables for your own sites etc.

Martin Lines (www.itlines.co.uk)
0
 
AmickCommented:
$time perl -MLWP::Simple -e 'get "http://www.example.com"' is a simple oneliner to get the latency of your website.  Time has many options that vary among the unix implementations that will make this easier to use, but if the website's latency is beyond acceptable limits, an alert can be raised.
0
 
thomasedooleyAuthor Commented:
Amick - and this is something I can run from a batch file?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thomasedooleyAuthor Commented:
I should mention we're a Windows shop... This script is meant to run on Win2008.
0
 
AmickCommented:
thomasedooley - yes, you can run this from a batch file.  Let me make it clear, though, that this is only the beginning of your script. You'll need to analyse your output and initiate your alert separately.

Also, perl can be run on Windows and there are downloads that provide the unix time function, such as CygWin, so it is not only a unix/linux method.

Finally, you may be just as happy writing the entire script in Perl, using the Benchmark-Timer module. http://search.cpan.org/~dcoppit/Benchmark-Timer-0.7101/lib/Benchmark/Timer.pm

Perl also has modules for e-mail, sms, paging, twitter, and just about any other alert initiation method you'd like to use.
0
 
AmickCommented:
Here's another alternative;

Download timethis.exe from  the windows 2000 resource kit.

Then use telnet to retrieve the web page as described in this Microsoft Support article

0
 
thomasedooleyAuthor Commented:
I went in an entirely different direction and went with Pingdom, which allows me to monitor on a 2 minute interval, and emails me alerts within a few minutes, and a summary every day. I do appreciate the experts' efforts.

I'm not sure whether I should award points or not, as the suggestions I received here were not exactly what I was looking for (maybe I was just being lazy). I do, however, want to be fair to the people that made an effort, as I am not unaware of the time experts spend responding to questions like mine.

What's the fair thing to do? Full award to Amick, partial to Amick, delete the question? I'm looking for direction, please...
0
 
thomasedooleyAuthor Commented:
I was advised by EE monitor to accept my own answer as the solution if, in fact, I found Pingdom on my own, which I did. It's not the solution I was looking for, as far as writing my own script to monitor my website, but it is very acceptable as an alternative, and it is free at this point. Thanks to the experts that made suggestions - I do very much appreciate your efforts.
Tom
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now