Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_url_status

Rating
4 votes
Favoured:
1
Hits
113740
Files:
FileDescription
check_url_status_1.3The plugin itself
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!
Checks the avaibility of websites and interpretes the returncode according to RFC 2616. Works with proxies, proxy authentication. Can check password protected websites.By Martin Fuerstenau
This plugin checks the status of websites and gives back the returncode according to RFC 2616 and the appropriate message string.

Opposite to check_url by yunus it uses NO system calls. Mainly for security reasons but a little bit for style.

It is based on libwww-perl and there is no need for system-calls.

The script support proxies with and without authentication via command line switches.

The script support checks for password protected websites via command line switches. You have to supply a user and a password.

This plugin is compatible with the Nagios plugin developer guidelines. Therefore a util.pm is needed and I supply an own one. The only difference to the one from the official plugin package is the contact address. You can use the original one. In that case the output from --help is not correct beecause there is a wrong contact. Thats all.

The documentation is within the plugin.


This plugin will not run from within the embedded perl of nagios 2.3 and higher due to the fact that embedded perl like on Apache has several restrictions. If you do not need the performance improvement it is easier not to use the embedded perl.



Attention:

In case of using a proxy be sure that all error codes are forwarded. If the proxy displays a error page of itself you check this page instead of the page you wanna check.

Version history:

1st Aug 2006 Version 1.0
- The site can be on the LAN or within the internet.
- The site can be behind a proxy with or without authentication.
- The plugin can handle proxy authentication on a user/password basis.
- Therefore a user and a password has to be submitted when calling the plugin
- The site can be whith or without authentication
- The plugin can handle website authentication.
- Therefore a user and a password has to be submitted when calling the plugin
For easier use the commandline options of the plugin are based on the syntax of wget.

13th Jun 2008 Version 1.1
- Added -o, --outout for giving back the checked URL

13th Jul 2010 Version 1.2
- Bugfix - proxy without user/password failed. Fixed
- Cleaned up the code a little bit.
- Removed the usage of utils.pm
- Removed the usage of global variables. my will do the work too. You can easily place comments after the definition and/or assign values to the variables at time of creating them.
- Redirected STDERR to /dev/null. Due testing I recognized that there are websites in UTF-8 causing an error like:

"Parsing of undecoded UTF-8 will give garbage when decoding entities at /usr/lib/perl5/vendor_perl/5.8.8/LWP/Protocol.pm line 114."

because this is a little bit confusing to users it is redirected. this warning is caused by libwww-perl itself and therefore it can not be covered by this program
- New switch -n | --negate to negate the result. For example a 200 is critical and a 500 is good

23rd Jul 2014 Version 1.3
- Bugfix - proxy connection failed with https. Fixed.
Reviews (2)
byTony-Caffe, May 20, 2015
1 of 1 people found this review helpful
Thank you for adding this plugin. Most dont let you specify htaccess login to check a site. IMO this is very crucial.

My Command Definition Example:

# 'check_url_status' command definition with htaccess login
define command{
command_name check_url_status
command_line $USER1$/check_url_status -U $ARG1$ --http-user=$ARG2$ --http-passwd=$ARG3$
}

Thanks!
byravikiran189, January 18, 2012
2 of 2 people found this review helpful
Its a good plugin though...But needs some modifications

For Nagios 2.X or 3.X do the following

#use lib "/usr/lib/nagios/ops_plugins" ;

needs to be replaced with

#use lib "/usr/local/nagios/libexec" ;



Thanks
RK
Owner's reply

Fixed. The actual version do not use utils.pm. Therefore adaption of the path is obsolete.