checkServers.pl - check the status of (possibly external) servers
(command line tool) perl checkServers.pl {--debug} {--timeout=xxx}
The optional "debug" switch enables (rather verbose) progress messages.
The optional "timeout" switch allows you to specify the timeout value for retrieving web pages. The default value is 120 seconds (2 minutes).
This command-line script makes web connections to a list of URLs which may reside on the server running this script, or on external servers. The script will retrieve the HTTP status code and if it receives a value other than 200, will e-mail an error message to a preselected list of addresses.
$mail{Smtp} = 'mail.server'; Set this line to the name or IP address of your outgoing (SMTP) mail server
%urls Set this hash to the URLs to be tested
@emails Set this array to the list of e-mail addresses to be notified when a URL scan produces a failed result
On Linux/Unix systems this can be easily accomplished with the following command lines: cpan install LWP cpan install Mail::Sendmail cpan install Getopt::Long
On Windows systems, running ActiveState Perl (http://www.activestate.com), you can easily install these modules by running the "ppm" program, and issuing the following commands: install Mail::Sendmail install Getopt::Long 1
Written by Daniel Mahoney <dan@trinetcom.com>
Copyright (c) 2006 by Trinet Internet Solutions. All rights reserved.
3 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
Unknown directive: =head
You forgot a '=back' before '=head1'
To install checkServers.pl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm checkServers.pl
CPAN shell
perl -MCPAN -e shell install checkServers.pl
For more information on module installation, please visit the detailed CPAN module installation guide.