Page 1 of 1
Website check behind proxy server
Posted: Sat Aug 04, 2012 9:22 pm
by stebbo
Hi All,
apologies if this has been asked a lot but I did some searching and couldn't find an answer. I am running the VMWare trial of Nagios XI. Most of the servers and services I want to monitor are internal, behind the site's router and proxy server, but I want to monitor a couple of websites on the Internet.
I can't get Nagios to get through to the website I'm trying to monitor as I don't know how to configure the http check to take the proxy into account. I did try downloading the proxy package as indicated in the FAQ, but that didn't work and it does seem to be only concerned with checking for updates.
Our web browsers are setup with a proxy pac file, but I do have access to a specific port which doesn't require any configuration, usernames or passwords. Generally in the computer I can set the proxy to be
http://xx.xx.xx.xx port 800 and then the computer will happily access the internet.
Is there some way I can configure the http check to do this? I saw one post which suggested the -l option but I couldn't seem to get this to work.
The error I'm currently getting is CRITICAL - Socket timeout after 10 seconds. I am assuming this is due to the proxy issue at this stage.
Many thanks,
Chris.
Re: Website check behind proxy server
Posted: Mon Aug 06, 2012 10:15 am
by yancy
stebbo,
Take a look at check_http_proxy
http://exchange.nagios.org/directory/Pl ... xy/details
here is how you would point your check at the proxy server:
Code: Select all
check_http_proxy --proxy=proxy:port --auth=user:pass --url=url --timeout=10.5 --warntime=5.0 --expect=content
Regards,
-Yancy
Re: Website check behind proxy server
Posted: Mon Aug 06, 2012 6:42 pm
by stebbo
Hello Yancy,
thanks for the response. I have installed that package and it shows as being present when I check the packages.
I have clicked on Views, Service Details, clicked on the service, clicked configure and Reconfigure this service. I enter the following command into the field labelled
"Monitor this service with this command (advanced users only"
Code: Select all
check_http_proxy --proxy=10.174.64.19:800 --url=www.lilydalehs.vic.edu.au --timeout=10.5 --warntime=5.0 --expect=content
but when I click update the system gives me an error as below. I also tried it with just one - for each argument not the two shown above.
Code: Select all
Configuration submitted for processing...
Waiting for configuration verification....
Configuration verification failed.
I would be grateful for any further assistance anyone could provide.
Cheers,
Chris.
Re: Website check behind proxy server
Posted: Tue Aug 07, 2012 9:54 am
by yancy
stebbo,
I'm not sure if you did this, but the script needs to be placed in your libexec directory of Nagios. You can use WinSCP or some other SCP client to copy the file to Nagios.
Once the file is store to libexec, try running from the command line.
Code: Select all
cd /usr/local/nagios/libexec
./check_http_proxy --proxy=10.174.64.19:800 --url=www.lilydalehs.vic.edu.au --timeout=10.5 --warntime=5.0 --expect=content
if this runs successfully, the check can be added to core config manger in Nagios.
Regards,
-Yancy
Re: Website check behind proxy server
Posted: Thu Aug 09, 2012 8:42 pm
by stebbo
Hello Yancy,
thanks for the reply. I can successfully run the following command from the command line
Code: Select all
check_http_proxy --proxy=10.174.64.19:800 --url=http://www.lilydalehs.vic.edu.au --timeout=10.5 --warntime=5.0 --expect=content
but I still can't get the service to update correctly within the nagios UI.
When I go to the core config manager, the command "check_http_proxy" is not listed in the drop down list. The script is in the /usr/local/nagios/libexec folder however. I must have missed some step when adding the package?
If I click views, then click on the service and go to advanced configuration, I can type the command in but it doesn't like it when I try to update the configuration. Not sure what to try next.
Cheers,
Chris.
Re: Website check behind proxy server
Posted: Fri Aug 10, 2012 7:56 am
by scottwilkerson
stebbo wrote:
When I go to the core config manager, the command "check_http_proxy" is not listed in the drop down list. The script is in the /usr/local/nagios/libexec folder however. I must have missed some step when adding the package?
Yes you did, you need to add the command in the CCM. Instructions here
http://library.nagios.com/library/produ ... -nagios-xi
Re: Website check behind proxy server
Posted: Fri Aug 10, 2012 10:44 pm
by stebbo
Thanks Scott and Yancy,
That document Scott linked to was exactly what I needed. I now have the website check working well.
Being a newbie I wasn't aware of having to add that command to the system. Might I recommend that a link to that document is placed on the "manage plugins" page? I just assumed that uploading the plugin was all I needed to do. There are a few other pages which have links to instructions and helpful hints which have helped me greatly so far.
I am very impressed with the software and the service. Thanks again.
Cheers,
Chris.