Check_http over a proxy
Re: Check_http over a proxy
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....
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Check_http over a proxy
Will have to sanitize it before posting. Will put it on the Exchange and drop a link here when done (tomorrow).
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Check_http over a proxy
Just back from vacation...I'll review new suggestions and report back.
thanks
thanks
Re: Check_http over a 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.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.
Re: Check_http over a proxy
For the record I have not gotten this working yet.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.
Re: Check_http over a proxy
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.
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Check_http over a proxy
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.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.
Re: Check_http over a proxy
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.
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.