"Cannot Make SSL Connection"

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.
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

"Cannot Make SSL Connection"

Post by scheema31 »

i am trying to monitor a webpage which has SSL.
Here is the command i am using:
/usr/local/nagios/libexec/check_http -S -H $ARG1$ -p 443 -u $ARG3$ --regex=$ARG2$ -w 3 -c 5 -t 10
And here is my defined service in windows.cfg:
define service{
use pager_generic-service
host_name sv-baygit-01.baynet.local
service_description - https://git.bayleaf.com -
check_command check_https!git.bayleaf.com!login!?next=/projects

However I'm getting a "Cannot Make SSL Connection" Error.

Thanks
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: "Cannot Make SSL Connection"

Post by jolson »

The '-S' flag will assume port 443, so you are free to remote '-p 443' from your command definition.

As for your command definition, I would make a few changes:

I would also throw quotes around your URL in your service definition: "?next=/projects"

Please run the following commands from the CLI to see whether or not they work:

Code: Select all

/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "?next=/projects" --regex=login -w 3 -c 5 -t 10
/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "/?next=/projects" --regex=login -w 3 -c 5 -t 10
I also noticed that git.bayleaf.com resolves to a private IP address - I figured I'd mention that since it could be relevant.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: "Cannot Make SSL Connection"

Post by scheema31 »

thanks for quick reply!
i ran the command suggested:
/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "?next=/projects" --regex=login -w 3 -c 5 -t 10
/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "/?next=/projects" --regex=login -w 3 -c 5 -t 10
however both are still giving me "CRITICAL - Cannot make SSL connection."

and yes its suppose to be binding to private IP, but i dont think that should affect the checks.
both the nagios server and application server are in the same domain, and nagios has no issue checking other checks on the server such as cpu, memory and service state.

Thanks
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: "Cannot Make SSL Connection"

Post by jolson »

Let's run a few basic checks against the site:

Code: Select all

/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "?next=/projects" 
/usr/local/nagios/libexec/check_http -S -H git.bayleaf.com
/usr/local/nagios/libexec/check_http -H git.bayleaf.com
Any chance any of the above work? What if you issue a curl to the site?

Code: Select all

curl https://git.bayleaf.com
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: "Cannot Make SSL Connection"

Post by ssax »

In addtion to jolson's recommendation, add the -v option on the check_http commands to give a little more info.
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: "Cannot Make SSL Connection"

Post by scheema31 »

Thanks for suggestion but Unfortunately adding "-v" did not show any additional output.
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: "Cannot Make SSL Connection"

Post by jolson »

Please follow the steps I posted above, and get the results back to us.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: "Cannot Make SSL Connection"

Post by scheema31 »

oops i missed that reply, but anyways here are my results:
1. /usr/local/nagios/libexec/check_http -S -H git.bayleaf.com -u "?next=/projects"
CRITICAL - Cannot make SSL connection.
2. /usr/local/nagios/libexec/check_http -S -H git.bayleaf.com
CRITICAL - Cannot make SSL connection.
3. /usr/local/nagios/libexec/check_http -H git.bayleaf.com
HTTP OK: HTTP/1.1 302 Found - 224 bytes in 0.011 second response time |time=0.011396s;;;0.000000 size=224B;;;0
4. curl https://git.bayleaf.com
curl: (35) Unknown SSL protocol error in connection to git.bayleaf.com:443

The -v option didn't display any output for the first two commands (1, 2 above), it gave following output for third command:
[root@svhomermon02 ~]# /usr/local/nagios/libexec/check_http -H git.bayleaf.com -v
GET / HTTP/1.1
User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)
Connection: close
Host: git.bayleaf.com
Accept: */*


http://git.bayleaf.com:80/ is 224 characters
STATUS: HTTP/1.1 302 Found
**** HEADER ****
Server: Apache-Coyote/1.1
Cache-Control: private
Expires: Wed, 31 Dec 1969 16:00:00 PST
Location: https://git.bayleaf.com/
Content-Length: 0
Date: Thu, 21 May 2015 22:40:58 GMT
Connection: close
**** CONTENT ****

HTTP OK: HTTP/1.1 302 Found - 224 bytes in 0.011 second response time |time=0.010968s;;;0.000000 size=224B;;;0

Thanks
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: "Cannot Make SSL Connection"

Post by Box293 »

Can you please run this command and post back the output:

Code: Select all

nmap git.bayleaf.com -p T:443
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
scheema31
Posts: 90
Joined: Wed Jun 06, 2012 1:11 pm

Re: "Cannot Make SSL Connection"

Post by scheema31 »

that commnad is not found.
im running it as root.
Locked