ISP-Check - Network Uptime Monitoring Tool


ISP-Check v1.0 - By JD Durick (jdurick@mitre.org)
Inital Release - August 6th, 2003

Purpose/Overview:
The ISP-Check scripts were originally written to monitor my ISP's connectivity. Gatehouse networks which originates in Delaware is anything but reliable and since I am spending $70 for service and 4 static ips, I feel it necessary to keep track of my uptime and notify them anytime it does go down.


The ISP-Check program uses 2 main perl scripts, isp-check.pl and isp-report.pl (dependant perl scripts listed below). These scripts will:

To view a running copy of ISP-CHECK, visit HERE

1. monitor your internet connection and check the connectivity of your ISP
2. Log all downtimes and write to a file
3. Calculate the percentage of downtime on a daily/monthly basis
4. Create a static web page featuring the results listed above
5. Calculates percentage of downtime per hour as part of the hourly breakdown statistics
6. Create archived yearly data which will show how much downtime you had in the year.
7. Graph the archived data via horizontal bars.


Current packages required:
1. Net::Ping - required for the pinging your gateway (or upstream router)
2. Getopt::Long - used for command line options
3. Time::HiRes - used for more granular time precision
4. Date::Calc - used to get the weekdays from a given date in time
5. GD::Graph::bars - used for plotting of bars for archived year data

Installation:
1. Unzip the file: isp-check.tar.gz (tar zxvf isp-check.tar.gz) - linux style.
2. OK, open up the isp-report.pl file and you will see this down about 20 lines in the perl code, make changes to the $SRC_DIR, $OUTPUT, $mainlog, and $servername variables.

# MAKE CONFIGURATION CHANGES HERE - All of these vars should be modified to meet the configuration of your system # SRC_DIR and OUTPUT are global vars and travel throughout the other functions #============================================================ $SRC_DIR="/usr/local/apache/htdocs/PING"; # location of where you will put the source code perl scripts $OUTPUT="/usr/local/apache/htdocs/PING/output"; # location of the .html files (where the html files will be viewed from) my $mainlog = "$OUTPUT/mainlog.txt"; # location and name of file that will be logged to by isp-check.pl my $servername = "denMail.labgeek.net"; # name of server (ie. webserver) #=============================================================


3. First, you want to run isp-check.pl every minute to get the best results (change vars to meet current configuration).
4. Next, set a cron job to run "isp-report.pl" every 30 min or 1 hour

* * * * * /usr/local/bin/isp-check.pl >/dev/null 2>/dev/null

the script (isp-check.pl)will run every minute and log all uptime and downtime to your specified file

3. The isp-report.pl script will calculate statistics and publish these on to a static web page configured by you.

OUTPUT File configuration

1 28 16:48 - 0 lost

1. Field 1: either will be a 1 for success or 0 for false
2. 28 represents the day of the month
3. 16:48 represents the time of the day
4. 0 or 1 will be the number of packets lost during the PING (the threshold can be customized)


HISTORY:
v0.1a - 08-06-2003: This is the initial release and needs plenty of work! Basically, I put this together in a night but will keep playing with it as long as I have s ome time....

v0.2a - 08-26-2003: Added link to daily minutes breakdown which takes you to another file listing when the connectivity dropped. Also added function to convert overa ll minutes down to days, hours, minutes, and seconds down.

v0.3 - 04-28-04: modularized each of the function into separate perl files

v1.0 - 06-03-04: Added Archive data that compiles year long downtime and then graphs it into a nice bar graph

v1.1 - 06-07-04: Got rid of the hard coded paths and now is configurable by anyone....still would like to have you create a configuration file via the website
TODO:
1. Add configuration file
2. Change output file configuration to add more fields
3. Add function that creates a random pool of routers that accept icmp connections so that you are not always pinging the same host over and over
4. Add command-line additions so that you can change parameters on the command line.
5. Notification options (mail)

LICENSE:

GNU GPL v2

Source Code files: Downloads: ChangeLog here.
README here
TODO here

Any problems/comments you have please send them to jd@labgeek.net