Website URL monitoring for site hosted on IIS windows 2012

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
edwinkamal
Posts: 6
Joined: Wed Apr 26, 2017 2:14 am

Website URL monitoring for site hosted on IIS windows 2012

Post by edwinkamal »

Hi

I have 2 windows servers and Installed the Nsclient++
These 2 servers connected with Load Balancers.
I have created the Linux nagios Server.
I want to monitor my URL. https://xxx.net/cyz/Home.aspx

Below is the command and Service description. But Servers says "
SSL Cert UNKNOWN check_http: Invalid option - SSL is not available


Belwo is the command section.I have used the both the below command option.


define service{
use generic-service
host_name xxx.NET
service_description check HTTP
#check_command check_https!-u /ui
check_command check_http!-H xxx.net -p 443 -u /tala -f follow -S -v -t 2

}


# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}


# Check https
define command{
command_name check_https
command_line $USER1$/check_http --ssl -H '$HOSTADDRESS$' -I '$HOSTADDRESS$' $ARG1$
}
Do we need to change anything specif to windows servers i nthe command section?
Do we need to change any setting NSclient.ini file?

Please advise

Thanks
Edwin
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by cdienger »

NSClient++ isn't actually needed here if the Nagios server is directly checking the url.

Try defining the service with the command:

check_command check_http!-f follow -u "/tala" -S -p 443 -v -t 2

And define the command as:

$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by tacolover101 »

i think the crux of the issue is based on your error message
SSL Cert UNKNOWN check_http: Invalid option - SSL is not available
your check_http may not be compiled with SSL support. you'll want to remove the -S flag from your command, and tell it to check on port 80. the other option, is re-compiling your plugins with SSL support. i think the packages are openssl and openssl-devel that are required.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by cdienger »

Thanks for the assist, tacolover101. edwinkamal, let us know your results once you've had a chance to test.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
edwinkamal
Posts: 6
Joined: Wed Apr 26, 2017 2:14 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by edwinkamal »

Hi Team

I have tried the below steps

yum -y install openssl openssl-devel
cd /tmp
wget http://www.nagios-plugins.org/download/ ... 1.5.tar.gz
tar xzf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure --with-openssl
make all
make install

Also changed the command as below:

define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}

# 'check_ssl_cert' command definition
define command{
command_name check_ssl_cert
command_line $USER1$/check_http --ssl -C 14 -H $HOSTADDRESS$ -I '$HOSTADDRESS$' $ARG1$ $ARG2$ $ARG3 $ARG4
}


Also changed the Service as below:

define service{
use generic-service
host_name xxx.NET
service_description check HTTP
check_command check_http!-f follow -u "/tala" -S -p 443 -v -t 2

define service{
use generic-service
host_name xxx.NET
service_description SSL Cert
check_command check_ssl_cert!-C 14 -H xxx.net -I 123.12.12.123
}



Now the result says critical:

check HTTP CRITICAL
CRITICAL - Socket timeout after 2 seconds

SSL Cert CRITICAL
CRITICAL - Socket timeout after 10 seconds

I have attached the screenshot for your reference.

Thanks
Edwin
Attachments
Attached the screenshot
Attached the screenshot
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by cdienger »

Are you able to run:

wget xxx.net/tala

and get a "200 OK" response?

Is there a web proxy that the request must go through? If so, the check_http command would need to be changed. https://www.monitoring-plugins.org/doc/ ... _http.html has details and examples.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
edwinkamal
Posts: 6
Joined: Wed Apr 26, 2017 2:14 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by edwinkamal »

When I try with Wget I am getting the below message

--2017-05-02 09:13:15-- wget https://xxx.net/tala
Resolving xxx.net (xxx.net)... failed: Name or service not known.
wget: unable to resolve host address âxxx.netâ
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by cdienger »

The Nagios server isn't able to resolve the hostname to an IP. Check /etc/resolv.conf to make sure the correct DNS servers are listed. You can also make a manual entry to /etc/hosts as a work around:

123.12.12.123 xxx.net
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by tacolover101 »

you probably need to setup your internal DNS records on the Nagios system. your linux admin should be able tohelp with that.

one other thing, you're calling to hostaddress, but the variable isn't even defined in what you posted.

Code: Select all

define host{
	host_name	host_name
	alias	alias
	display_name	display_name
	address	address
see - https://assets.nagios.com/downloads/nag ... tions.html
edwinkamal
Posts: 6
Joined: Wed Apr 26, 2017 2:14 am

Re: Website URL monitoring for site hosted on IIS windows 20

Post by edwinkamal »

hi

I have already defined the host name with my LLB url name

Thanks
Edwin
Locked