Remote HTTP response alive tester and monitor
I couldn’t find a good and simple http monitoring script so I made one in Perl.
- Makes a HTTP GET request to a list of URLS or just one
- Sends an email if a URL can not be accessed with the error details in the email
- Outputs status of URL to terminal
- 4 lines to configure it
- Doesn’t use any weird Perl modules
I don’t usually write stuff in Perl so go easy.
Download/View it. httpcheck.txt
I have mine installed:
# m h dom mon dow command
30 * * * * /home/michael/alivecheck.pl >> /home/michael/alivecheck.log
checking every 30 mins of every day
enjoy.
November 4th, 2007 at 12:53 am
At work we use Nagios (nagios.org) for this kind of thing. Maybe it is overkill and maybe it is difficult to set up. Worth a look if you have not discovered it yet, though.
November 4th, 2007 at 1:05 am
Yeah, I’ve used nagios for some time it’s pretty good. The reason I didn’t use it here is because nagios is really suited to sit on a particular server and monitor many servers and services. Where as I only wanted to monitor one server and one service.
This script can also sit on any any machine with Perl (most distro’s have it installed by default) at the ease of uploading it to the server.