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


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
Reviews (7) Add a Review
Very Helpful
by amol.ac, June 30, 2015
I t works great ! Thanks !
Helpful? Yes  No 
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.
Helpful? Yes  No 
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.
Helpful? Yes  No 
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.
Owner's Reply:

Hi Symmetry, just add the port to your URL i.e. -u www.google.com:99


1 of 1 found this review helpful.
Helpful? Yes 1 No 0
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
Helpful? Yes  No 
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? Yes  No 
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"
3 of 3 found this review helpful.
Helpful? Yes 3 No 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,171