Solved

External script to check website health

Posted on 2011-03-02
8
309 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 103
VB6 Compile Compatibility Issue 4 90
how to send memory stream from ics Client To ics server ? 11 83
C# DataGridView_RowsAdded event not firing 1 66
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
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…

863 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

24 Experts available now in Live!

Get 1:1 Help Now