Monitor an external website

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Monitor an external website

Post 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.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor an external website

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: Monitor an external website

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor an external website

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: Monitor an external website

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor an external website

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: Monitor an external website

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor an external website

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
psasines
Posts: 43
Joined: Wed Nov 21, 2018 5:19 am

Re: Monitor an external website

Post by psasines »

Hi,

Using http_check?

Thanks in advance,
PSA
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitor an external website

Post 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>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked