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
HTTP + Proxy
Re: HTTP + Proxy
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?
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.
"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.
Re: HTTP + Proxy
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"
Command from the Nagios server where I get "HTTP WARNING: HTTP/1.1 401 Unauthorized":
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
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
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 109.169.1.114 -c check_http
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
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: HTTP + Proxy
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
Yes, it's really odd =/.
Thanks for looking into it.
Thanks for looking into it.
Re: HTTP + Proxy
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.
"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.