Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitoring Website Availability

Status
Not open for further replies.

UrbanViking

IS-IT--Management
Jan 27, 2006
6
US
I am looking for open source software that monitors the availability of a website by making requests at given intervals. I have found lots of stress testing software but none that monitors the websites availability 24/7. If you know of anything I would really appreciate it if you could point me in the right direction.

P.S. If the program supported e-mailing alerts for certain events that would be a plus.

Thanks

Mason McElroy
 
Here's a perl script I wrote to do just that:
Code:
#!/usr/bin/perl
use warnings;
use LWP::Simple;
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
#following will authenticate to an ISA proxy
#$ua->proxy(['http', 'ftp'] =>'[URL unfurl="true"]http://username:password@FQDN.of.proxy:8080');[/URL]
$req = HTTP::Request->new('GET', "[URL unfurl="true"]http://www.myserver.com/page_I_care_about.html");[/URL]
$res = $ua->request($req);
my $page = $res->content if $res->is_success;
I then parse out a timestamp on that page and print it to STDOUT
Code:
my @chars = split(/>/, $page);
my @datetime = split(/</, $chars[31]);
print "\n timestamp is $datetime[0] \n";

This should get you started.
 
Simple shell script to do it ...

Code:
while [ 1=1 ]
do
        rm -f page.html
        wget [URL unfurl="true"]http://www.server.com/home.jsp[/URL] -O page.html

        if [ `file page.html | cut -d ':' -f2` = "empty" ]
        then
                echo "cannot find website page home.jsp" |mail -s "web site is down !" me@email.com
        fi

        sleep 10
done

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I have a really crappy php script that just pings a domain, then sends my cell phone a text message if it doesn't respond:

Code:
<?php
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: alerts@mydomain.com\r\n";

$PingResponse = `ping -c 4 [URL unfurl="true"]www.mydomain.com`;[/URL]
$PingCheck = strpos ($PingResponse, "bytes from");
if (!$PingCheck)
{
        $Notification = '[URL unfurl="true"]www.mydomain.com[/URL] is not responding to ping requests.';
        mail("my-cell-number@vtext.com", "", "$Notification", "$headers");
}
?>
uber-tech ;)
 
I was going to say Nagios. I *LOVE* That program. I use it to monitor 5 hotels, their gateways, and their wireless access points which are BEHIND NAT.......

It's a little weird to get configured, but once you do, it rocks. It allows for notification when something is down (and allows you to set threshholds for what is considered a problem, or critical) and can alert you via e-mail, page, etc. Additionally, it has a built-in WAP interface for monitoring sites right from your WAP enabled cell phone.



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
NAGIOS is awesome. I use a packaged version called Sentinix (it may no longer be available) that bundled Nagios with the web configurator, Snort, and a handful of other tools into a CentOS-based bootable ISO installation image. Just about the easiest way to get started with Nagios.....
 

Nagios is *awesome*

Also amokeping is brilliant and very easy to set-up. Only pings though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top