Check https not working

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.
Locked
bostjanc
Posts: 17
Joined: Mon Mar 21, 2016 11:12 am

Check https not working

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check https not working

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bostjanc
Posts: 17
Joined: Mon Mar 21, 2016 11:12 am

Re: Check https not working

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check https not working

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
bostjanc
Posts: 17
Joined: Mon Mar 21, 2016 11:12 am

Re: Check https not working

Post 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
bostjanc
Posts: 17
Joined: Mon Mar 21, 2016 11:12 am

Re: Check https not working

Post 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!!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check https not working

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked