Page 1 of 2

Monitor an external website

Posted: Mon Oct 14, 2019 12:18 pm
by psasines
Hi,

We need to monitor an website outside our network.
To access internet we have a proxy server in place.
Is it possible to monitor the website via proxy without disrupting or forcing all other checks via proxy?

Thanks in advance.

Re: Monitor an external website

Posted: Mon Oct 14, 2019 1:07 pm
by mbellerue
Is the Nagios server setup to use the proxy by default when accessing the internet? And are all of your other checks on the internal network?

If so, then you should be good to use the regular check_http plugin. With that plugin you can specify the proxy server credentials (--proxy-authorization=username:password), and it will only use those when it attempts to access the internet. All other checks on the local network should just go to the servers they were intended to go to.

Re: Monitor an external website

Posted: Tue Oct 15, 2019 3:19 am
by psasines
Hi,

On the Admin -> System Config -> Proxy Configuration, our proxy is configured there.
(is this what you were mentioning on your first question?)

All other checks are for internal network.

I went to Configure -> Configuration Wizards -> Website -> Website Step 1 -> inserted the website to monitor -> Website Services "HTTP"
All other next options I left them by default.

Like this the website I wanted to monitor is being reported as "down" in Nagios.

Thanks in advance,
PSA Sines

Re: Monitor an external website

Posted: Tue Oct 15, 2019 1:36 pm
by mbellerue
If you ssh into the Nagios server, and ping the website, is it able to resolve the IP address, and get out to the website? It may not get all the way to the website, as your proxy server may not allow it. Try curl <websiteurl> and see if it brings back a bunch of HTML.

Re: Monitor an external website

Posted: Wed Oct 16, 2019 10:31 am
by psasines
Hi mbellerue,

From the Nagios server the IP of the website is resolved correctly, although I don't get any replies.
As for the curl, this is the result:

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Kind regards,
PSA Sines

Re: Monitor an external website

Posted: Wed Oct 16, 2019 10:57 am
by mbellerue
Alright, let's try manually building the check. Try this command,

Code: Select all

/usr/local/nagios/libexec/http_check -I <SiteIP> -b proxyuser:proxypass
If that works, then we should just make a new command to check via the proxy, and remove the proxy configuration from within the Nagios XI interface. This way all of your other checks will just go over the network, rather than through the proxy.

Re: Monitor an external website

Posted: Wed Oct 16, 2019 11:07 am
by psasines
Hi,

The http_check doesn't work.
-bash: /usr/local/nagios/libexec/http_check: No such file or directory

Our internal proxy doesn't need username/password.

Do I need to install the http_check command?


Kind regards,
PSA Sines

Re: Monitor an external website

Posted: Wed Oct 16, 2019 12:39 pm
by mbellerue
I'm sorry, I had that backwards. It's check_http

Also, if your proxy doesn't require a username/password, then you can skip that part. Let's just see if it tries to go out and reach the site.

Re: Monitor an external website

Posted: Thu Oct 17, 2019 5:11 am
by psasines
Hi,

Using http_check?

Thanks in advance,
PSA

Re: Monitor an external website

Posted: Thu Oct 17, 2019 8:58 am
by mbellerue
Yes, since your proxy doesn't require authentication, let's just run the command like this.

Code: Select all

/usr/local/nagios/libexec/check_http -I <SiteIP>