Page 1 of 1
Check website through a proxy
Posted: Wed Nov 23, 2016 11:31 am
by soporteBHUY
Hello, I am a little new to Linux and Nagios, so, please excuse me if my question is too easy.
I have installed Nagios XI 5.2.9, from the VM image downloaded from official site, running on a ESXi 6.x.
My Nagios XI VM does not have direct access to internet, I have to use a internal Proxy Server to access websites.
My question is, how do I configure nagios to access internet through a proxy server (does not require autentication), in order to be able to monitor websites.
Also I need to prevent Nagios to use Proxy server to access specific internal networks.
Thanks in advance
Re: Check website through a proxy
Posted: Wed Nov 23, 2016 1:47 pm
by mcapra
We don't officially support installations that exist behind proxies, but we have a KB article with some potential solutions:
https://support.nagios.com/kb/article.php?id=147
The help for the check_http plugin includes some information in regards to dealing with proxies when checking websites:
Code: Select all
/usr/local/nagios/libexec/check_http -h
Re: Check website through a proxy
Posted: Wed Nov 23, 2016 1:51 pm
by avandemore
Please see:
https://support.nagios.com/kb/article.php?id=147
Also I need to prevent Nagios to use Proxy server to access specific internal networks.
Nagios and its checks are going to obey whatever the operating system environment tells it:
Code: Select all
export http_proxy="http://proxy.com:8000"
export no_proxy="127.0.0.1, localhost, 192.168.1.10, domain.com:8080"
You can set these at the user or application level, but they need to be set in order to be obeyed.
Re: Check website through a proxy
Posted: Wed Nov 23, 2016 2:01 pm
by rkennedy
For check_http you can use something like this -
Code: Select all
[root@centos7x64 libexec]# ./check_http -H 192.184.x.x -p 3128 -b user:pass -u http://mydomain.com -f follow -v
GET http://mydomain.com HTTP/1.1
User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)
Connection: close
Host: 192.184.x.x:3128
Accept: */*
Proxy-Authorization: Basic eDpwNHNzdzByZA==
http://192.184.x.x:3128http://mydomain.com is 862 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Date: Wed, 23 Nov 2016 18:56:33 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 652
Content-Type: text/html; charset=UTF-8
Proxy-Connection: Close
**** CONTENT ****
HTTP OK: HTTP/1.1 200 OK - 862 bytes in 0.573 second response time |time=0.572974s;;;0.000000 size=862B;;;0
From the web server side -
Code: Select all
==> /var/log/httpd/access_log <==
192.184.x.x - - [23/Nov/2016:13:56:33 -0500] "GET / HTTP/1.1" 200 652 "-" "check_http/v2.0.3 (nagios-plugins 2.0.3)"