We are moving our nagios server behind a firewall and will need to route a lot of our check_http over a proxy
I have added variables to /etc/sysconfig/nagios and have confirmed /etc/init.d/nagios is sources that file and have restarted.
However, none of my check make it through.
Is there a way to verify that it is actually sourcing that file?
Where else can I universally set proxy settings so I don't have to re-write all of my checks?
From the command line:
./check_http --hostname={HOSTNAME} -v
CRITICAL - Socket timeout after 10 seconds
./check_http --hostname={HOSTNAME} -L {PROXY} -v
...
**** CONTENT ****
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.7</center>
</body>
</html>
Thanks in advance
Check_http over a proxy
Re: Check_http over a proxy
What operating system are you running on? Did you update your profile to have the proxy added?
Former Nagios Employee.
me.
me.
Re: Check_http over a proxy
redhat linux 6.something.
What profile? It is a shell environment setting already (etc/profile.d/{shell}.sh and .bash) and in /etc/sysconfig/nagios where the nagios documents say to put it.
Is there somewhere else my proxy settings should be so that nagios traffic naturally flows over it?
What profile? It is a shell environment setting already (etc/profile.d/{shell}.sh and .bash) and in /etc/sysconfig/nagios where the nagios documents say to put it.
Is there somewhere else my proxy settings should be so that nagios traffic naturally flows over it?
Re: Check_http over a proxy
Is this the document you were referring to?
https://support.nagios.com/wiki/index.p ... th_Proxies
I was referring to ~/.bash_profile
https://support.nagios.com/wiki/index.p ... th_Proxies
I was referring to ~/.bash_profile
Former Nagios Employee.
me.
me.
Re: Check_http over a proxy
FYI: that makes no difference because the same environment settings are pulled in from /etc/sysconfig/profile.d/{name}.sh or bash when the nagios user logs in.
Re: Check_http over a proxy
Your reply only talks about nagiosXI...is there a similar nagios core 4.1.1 solution?
Re: Check_http over a proxy
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.
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.
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Check_http over a proxy
You may use the following to check a proxy without messing with the system
$WGET --proxy-user "domain\users" --proxy-password "mypassword" -t 1 --timeout=$TIMEOUT --proxy --execute=http_proxy=$HTTP_PROXY -O $PROXIED_FILE $SAMPLE_URL $LOG
Inside the script (line 73) you can define a user:define command{
command_name check_proxy_auth
command_line $USER1$/check_proxy $ARG1$ $ARG2$ $ARG3$
}
check_command check_proxy_auth!proxy1:8080!www.kernel.org!40
$WGET --proxy-user "domain\users" --proxy-password "mypassword" -t 1 --timeout=$TIMEOUT --proxy --execute=http_proxy=$HTTP_PROXY -O $PROXIED_FILE $SAMPLE_URL $LOG
Re: Check_http over a proxy
Former Nagios Employee.
me.
me.
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Check_http over a proxy
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.
export http_proxy=http://192.168.0.1:3128
Modify the above if you want to add username or password to access proxy.