Home Directory Plugins Websites, Forms and Transactions Check Proxy with Authentication

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 Proxy with Authentication

Rating
1 vote
Favoured:
0
Hits
104659
Files:
FileDescription
check_httpproxy.shcheck_httpproxy.sh bash script
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!
This BASH script uses wget and its parameters to accept a proxy server IP plus credentials to access the website passed to it. It uses spider functionality to access the website and confirm that the correct site is accessed. Block pages are recognized as
The script uses the standard BASH framework used in other plugins.

+++ Requires:

* utils.sh included with nagios
* recent wget installation (test only with 1.9+cvs-stable)

The script gets the http_proxy parameters from the command line and export them to this wget variable. An installation of wget that supports the spider option.

+++ Returns:

STATE_OK if wget execution is successful, STATE_CRITICAL if wget execution encounters an error, and STATE_UNKNOWN for everything else.


+++ Known Issues:

Some webpages like http://www.dhs.gov don't work properly. I think it has something to do with how the web page directory is published. This causes wget to just hang. Most pages seem to work though.


+++ Future:

I hope to add in https functionality. At the moment, it only supports http.


+++ Notes:

This was tested against BlueCoat proxy boxes only. It should work for any old HTTP proxy, but since this script is based on wget, you probably want to research wget proxy support if you have problems.


+++ Credits:

Nagios project for their script outline for returning results to the nagios engine and to Sun Yu for introducing me to the wget tool. Naturally, I must thank Mauro Tortonesi(maintainer) and Hrvoje Nikši?(creator) for bringing us this great tool.
Reviews (1)
Thanks for providing this script!

A few issues I ran into:
- The help shows -u for the username and -u for the url, it should be -URL
- On a recent Ubuntu installation it didn't recognize the "support" command on line 48, I don't recognize it either - I just removed it.
- Would be handy to make the --spider optional, I removed it in my case.
- Line 31: PROGPATH=... doesn't work when you put the script in the typical [/usr/lib/nagios/plugins/contrib] folder, it needs to find utils.sh in the parent folder.