Page 2 of 4
Re: Check_http over a proxy
Posted: Tue Oct 06, 2015 2:19 pm
by eloyd
A long time ago, I rewrote check_http to use curl instead of whatever it does today. It included all the curl-style proxy options. If that might help, I might still have a copy somewhere....
Re: Check_http over a proxy
Posted: Tue Oct 06, 2015 2:28 pm
by hsmith
I would be interested in this

Re: Check_http over a proxy
Posted: Tue Oct 06, 2015 2:35 pm
by eloyd
Will have to sanitize it before posting. Will put it on the Exchange and drop a link here when done (tomorrow).
Re: Check_http over a proxy
Posted: Tue Oct 06, 2015 2:52 pm
by hsmith
Great, thanks!
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:32 am
by mleo40
Just back from vacation...I'll review new suggestions and report back.
thanks
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:35 am
by mleo40
amprantino wrote:To force traffic pass through a proxy add the following
export http_proxy=http://192.168.0.1:3128
Modify the above if you want to add username or password to access proxy.
I'm not sure what to add this to. It appears to be just a shell environment, which nagios doesn't use when executing its commands.
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:36 am
by mleo40
jolson wrote:I'd like to know more about the configuration changes that you made to get your proxy working, and any guides you may have followed. What does your /etc/sysconfig/nagios files look like?
cat /etc/sysconfig/nagios
It is my understanding that Nagios Core is not aware of /etc/sysconfig/nagios, which is why I'm curious about any guides you might have followed. In my experience, re-writing your service checks is the only way to accomplish what you're trying to do, but if you have a guide or information that states otherwise I would like to see it.
For the record I have not gotten this working yet.
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:46 am
by eloyd
Every user, including the nagios user, has a shell environment. I think the idea was to add this to the nagios user's .cshrc or .bashrc file to set the proxy variable.
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:53 am
by mleo40
eloyd wrote:Every user, including the nagios user, has a shell environment. I think the idea was to add this to the nagios user's .cshrc or .bashrc file to set the proxy variable.
I see. That doesn't help as I've tried that already. Our environment automatically includes shell info for everyone to use the proxy already.
Re: Check_http over a proxy
Posted: Fri Oct 16, 2015 11:56 am
by mleo40
I changed my checkcommands.cfg as follows:
define command {
command_name check_http
command_line $USER1$/check_http -I {IPOFMYPROXY} --hostname=$HOSTADDRESS$
}
and it worked.
However....this means EVERY check_http will use the proxy, even internal stuff....right? I don't want that either as this fix will break currently working check_http stuff that doesn't require the use of the proxy.
It seems as if I will have to re-structure all my checks and tell nagios which one is a "over-proxy" check and what isn't.
Still hoping for a better solution.