Page 1 of 2

"Cannot Make SSL Connection"

Posted: Thu May 21, 2015 12:45 pm
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

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 1:34 pm
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.

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 4:51 pm
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

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 4:57 pm
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

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 5:01 pm
by ssax
In addtion to jolson's recommendation, add the -v option on the check_http commands to give a little more info.

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 5:10 pm
by scheema31
Thanks for suggestion but Unfortunately adding "-v" did not show any additional output.

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 5:12 pm
by jolson
Please follow the steps I posted above, and get the results back to us.

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 5:43 pm
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

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 6:35 pm
by Box293
Can you please run this command and post back the output:

Code: Select all

nmap git.bayleaf.com -p T:443

Re: "Cannot Make SSL Connection"

Posted: Thu May 21, 2015 6:39 pm
by scheema31
that commnad is not found.
im running it as root.