Websites, Forms and Transactions

Check website response

Description:

This plugin is used to monitor website up time and response time.

Error codes will be returned if the website is not responding, the URL does not contain data, does not resolve, or responds slower than specified with the warning and critical input options.

Usage: check_website_response.sh -w (warning milliseconds) -c (critical milliseconds) -u (url) [ -nocert ]

This script has the following dependencies – netcat, date, wget, echo, awk, tr and cksum.

commands.cfg needs to contain something like the following:

# ‘check_website_response’ command definition
define command{
command_name check_website_response
command_line $USER1$/check_website_response.sh -u $ARG1$ -w $ARG2$ -c $ARG3$
}

Called with the following command:

check_command check_website_response!”http://www.domain.com/index.html”!1000!2000

This script will work on POSIX systems has been tested with the Dash shell in Linux Debian and Nagios core 3.2.1

To use the –no-check-certificate option configure as follows:

command_line $USER1$/check_website_response.sh -u $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$

check_command check_website_response!”http://www.domain.com/index.html”!3000!4000!-nocert

Current Version

1.1

Last Release Date

2012-05-24

Compatible With

  • Nagios 2.x
  • Nagios 3.x

License

GPL


Project Files
Project Notes
Reviews (7) Add a Review
Very Helpful
by amol.ac, June 30, 2015

I t works great ! Thanks !



Works great
by Tony-Caffe, July 31, 2013

I made a few changes since I have a Load Balancer for my 7 webservers and wanted to apply the links to multiple URLs. I added checks but changed service this way: define service{ host_name web2,web3,web4,web5,web6 service_description blog.website.com check_command check_nrpe!check_website_response_blog This was it will check the local web server and then on the local web server I added this: command[check_website_response_blog]=/usr/lib64/nagios/plugins/check_website_response.sh -u http://blog.website.com/?web2 -w 200 -c 200 Now when a web site goes down it tells me what server its on and that I use "/?web2" to force to use a server instead of letting load balancer decide. Very good tool. Thank you.



Simple ..
by TrevThorpe, October 31, 2012

One of those simple things that is simple to add in, and just works. Had to modify the NETSTAT variable to work with my linux release... trivial. Exellent, thanks.



Can't monitor non standard HTTP or HTTPS ports
by symmetry, April 30, 2012

Great add-on works well although I cannot get it to work with a non standard HTTP or HTTPS webpage running on TCP port other than 80 or 443. Does anyone know if its possible to alter part of the code so I can monitor other ports. Sorry am a bit of a noob so don't know much coding.



how to use this in services.cfg
by a.shamsan81, March 31, 2012

dears all; i need help on how to use this with services.cfg, what would be the host_name?? any idea



Performance data
by pydubreucq, September 30, 2011

Hi, This script works fine for us too. And the patch works fine too and it's compatible with Centreon Bye



Helpful
by dkwiebe, August 31, 2011

This script works very well for us. There's one minor tweak that can make it more useful. This patch will allow you to output performance data that you can log using pnp4nagios. Change line 157 from $ECHO "RESPONSE: $STATUS - $OUTMSG" to $ECHO "RESPONSE: $STATUS - $OUTMSG""|Response="$TIMEDIFF"ms;"$WARN";"$CRIT";0"



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.8 (12)
Favorites
2
Views
188,210