Page 1 of 1

HTTP + Proxy

Posted: Mon Nov 04, 2013 5:28 pm
by badcom
Hi,

There's a server which I want to execute a check_http, however this server restricts HTTP access to a few IP addresses.

If I run the check_http from the remote server, I get a "HTTP OK: HTTP/1.1 200 OK", but if I add a command to "/etc/nagios/nrpe.d/agent.cfg" and then call this command from the Nagios server, I get a "HTTP WARNING: HTTP/1.1 401 Unauthorized".

I thought that the command would be called from the remote server and, therefore, it would work because its IP address is allowed.

Does it make sense? Am I missing anything here?

Thanks in advance,
Vilmondes

Re: HTTP + Proxy

Posted: Mon Nov 04, 2013 5:58 pm
by abrist
Is apache setup to allow connections externally (from any other address other than 127.0.0.1?
Could you post a copy of the command definition and the check configuration for this check_http check?

Re: HTTP + Proxy

Posted: Mon Nov 04, 2013 6:27 pm
by badcom
The URL called is an external URL. It's a client's tool and this tool allows specific IP addresses to connect to it (our proxy address is one of them).

Command on the remote server which is the one that I get the "HTTP OK: HTTP/1.1 200 OK"

Code: Select all

command[check_http]=/usr/lib/nagios/plugins/check_http -N -H url_address -S
Command from the Nagios server where I get "HTTP WARNING: HTTP/1.1 401 Unauthorized":

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 109.169.1.114 -c check_http
I think that I should get the same result in both as the check_http is actually called from the remote host in both cases. The only difference is that I use nrpe from the Nagios server. However, given the above results, my conclusion is that the client's tool is getting the Nagios server's IP address instead of the remote server's IP.

There's no check configuration yet. I'm calling the commands manually just to test them.

Let me know if you need any other information.

Thanks,
Vilmondes

Re: HTTP + Proxy

Posted: Tue Nov 05, 2013 3:54 pm
by slansing
We're going to do a bit of digging on this one, currently we cannot validly replicate this in-house. It is odd though, as the command is still being ran locally even when you call it through NRPE..

Re: HTTP + Proxy

Posted: Tue Nov 05, 2013 8:43 pm
by badcom
Yes, it's really odd =/.

Thanks for looking into it.

Re: HTTP + Proxy

Posted: Wed Nov 06, 2013 2:09 pm
by abrist
Can you post the nagios core service check definition for "check_nrpe" ?