check_url_status
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
- 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.
-
Version 1.1
-
Added -o, --outout for giving back the checked URL (Martin Fuerstenau, Oce Printing Systems, martin.fuerstenau_at_oce.com, 13.6.2008)
-
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
Martin Fuerstenau, Oce Printing Systems, martin.fuerstenau_at_oce.com, 13.7.2010