HTTP + Proxy

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
badcom
Posts: 11
Joined: Fri Oct 25, 2013 7:15 pm

HTTP + Proxy

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: HTTP + Proxy

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
badcom
Posts: 11
Joined: Fri Oct 25, 2013 7:15 pm

Re: HTTP + Proxy

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: HTTP + Proxy

Post 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..
badcom
Posts: 11
Joined: Fri Oct 25, 2013 7:15 pm

Re: HTTP + Proxy

Post by badcom »

Yes, it's really odd =/.

Thanks for looking into it.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: HTTP + Proxy

Post by abrist »

Can you post the nagios core service check definition for "check_nrpe" ?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked