Solved

External script to check website health

Posted on 2011-03-02
8
311 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Author Comment

by:thomasedooley
ID: 35018390
I should mention we're a Windows shop... This script is meant to run on Win2008.
0
 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

770 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