Page 1 of 1

Check https not working

Posted: Wed Nov 06, 2019 4:39 am
by bostjanc
Hi.
Need a little help.

When we use Nagios command check_http with http site it works ok:
Command: check_http_pattern
Command line: $USER1$/check_http -I $HOSTADDRESS$ -u $ARG1$ -r $ARG2$

but if we wish to check https://internalsite.com we receive an error:
HTTP CRITICAL: HTTP/1.1 302 Found - pattern not found - 889 bytes in 0.037 second response time

Site also has redirection from http to https if that causes that error?
We have tried also putting in argument 1: http instead of https but still will not work.

please help.
with best regards

Re: Check https not working

Posted: Wed Nov 06, 2019 9:05 am
by scottwilkerson
bostjanc wrote:Site also has redirection from http to https if that causes that error?
Yes, you may want to follow the redirect by adding the following to the command

Code: Select all

 -f follow
Otherwise, we need to see what you are running from the command line to know what else you could be hitting.

Re: Check https not working

Posted: Wed Nov 06, 2019 9:58 am
by bostjanc
Hi.

Thank you for your reply.

If we run on Nagios server:

cd /usr/local/nagios/libexec/
./check_http -I "192.168.1.41" -u "https://oursite.com/Home/Ping" -r "OK"
HTTP CRITICAL: HTTP/1.1 302 Found - pattern not found - 889 bytes in 0.037 second response time |time=0.037284s;;;0.000000 size=889B;;;0

and if we run command:
./check_http -I "192.168.1.41" -u "https://oursite.com/Home/Ping" -r "OK" -f follow
CRITICAL - Socket timeout after 10 seconds

./check_http -I "192.168.1.41" -u "http://oursite.com/Home/Ping" -r "OK" -f follow
CRITICAL - Socket timeout after 10 seconds

Re: Check https not working

Posted: Wed Nov 06, 2019 10:01 am
by scottwilkerson
How about

Code: Select all

./check_http -I "192.168.1.41" -H "oursite.com" -u "/Home/Ping" -S -r "OK" -f follow

Re: Check https not working

Posted: Thu Nov 07, 2019 3:19 am
by bostjanc
hi.
thank you for your reply.
If we run that command we receive an error:
check_http: Invalid option - SSL is not available

and if we run:
nmap nagiosSERVER.domain..com -p 443

Starting Nmap 6.40 ( http://nmap.org ) at 2019-11-07 00:15 PST
Nmap scan report for nagiosSERVER.domain.com (192.168.1.13)
Host is up (0.000071s latency).
PORT STATE SERVICE
443/tcp closed https

Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
which openssl
/usr/bin/openssl

Does Nagios server needs SSL enabled if we want to check SSL site (our web server)?

Running nmap to check webserver from nagios:
If we run on nagios:
nmap IP-OF-WEB-SERVER -p 443

Starting Nmap 6.40 ( http://nmap.org ) at 2019-11-07 00:17 PST
Nmap scan report for webserver.domain.com (192.168.1.41)
Host is up (0.00032s latency).
PORT STATE SERVICE
443/tcp open https
MAC Address: AC:1F:6B:C5:51:EC (Unknown)

Nmap done: 1 IP address (1 host up) scanned in 0.10 seconds

Re: Check https not working

Posted: Thu Nov 07, 2019 4:00 am
by bostjanc
Hi.
Just wanted to let you know that I had solved problem with commands:
cd /tmp/nagios-plugins-2.1.1/

./configure --with-openssl=/usr/bin/openssl
make
make install

thanks for all the help!!!

Re: Check https not working

Posted: Thu Nov 07, 2019 7:36 am
by scottwilkerson
bostjanc wrote:Hi.
Just wanted to let you know that I had solved problem with commands:
cd /tmp/nagios-plugins-2.1.1/

./configure --with-openssl=/usr/bin/openssl
make
make install

thanks for all the help!!!
Great!

Locking thread