Solved

External script to check website health

Posted on 2011-03-02
8
308 Views
Last Modified: 2012-05-11
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
Comment
Question by:thomasedooley
  • 4
  • 3
8 Comments
 

Expert Comment

by:mdlines
ID: 35017663
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
 
LVL 12

Expert Comment

by:Amick
ID: 35018096
$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
 

Author Comment

by:thomasedooley
ID: 35018290
Amick - and this is something I can run from a batch file?
0
 

Author Comment

by:thomasedooley
ID: 35018390
I should mention we're a Windows shop... This script is meant to run on Win2008.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 12

Expert Comment

by:Amick
ID: 35018565
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
 
LVL 12

Expert Comment

by:Amick
ID: 35018881
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
 

Accepted Solution

by:
thomasedooley earned 0 total points
ID: 35158035
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
 

Author Closing Comment

by:thomasedooley
ID: 35390512
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now