check_http CRITICAL - Socket timeout

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
mrochelle
Posts: 238
Joined: Fri May 04, 2012 11:20 am
Location: Heart of America

check_http CRITICAL - Socket timeout

Post by mrochelle »

Nagios XI 3.2 64 Bit VM install
CentOS release 6.2

I'm using Website URL host wizard to monitor approx 200 hosted websites across 4 web servers. The actual Host check command is as follows:
check_xi_service_http!-S !!!!!!! against the dns.hostname.com.
For websites on 2 of the 4 servers I get this error [ CRITICAL - Socket timeout after 10 seconds ], but I am able to access the sites without problem from the browser. I have used the check_http from the command line to vary the timeout with no change. Since the problem is limited to 2 of the 4 servers, and all sites on those servers so far, is there a test or check that I could provide my network support team to help identify the problem? I'm guessing it is either a configuration problem on those two servers or possibly a firewall problem? Thoughts, comments, appreciated.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http CRITICAL - Socket timeout

Post by scottwilkerson »

When you connect to these through your browser are you using https:// ?

You have the SSL flag specified with the -S so it is trying to connect via SSL
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mrochelle
Posts: 238
Joined: Fri May 04, 2012 11:20 am
Location: Heart of America

Re: check_http CRITICAL - Socket timeout

Post by mrochelle »

yes. All the sites including both those that work and those that don't use SSL.
I've also downloaded the netcat utility if it can be of any use.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_http CRITICAL - Socket timeout

Post by lmiltchev »

I wonder if this is ipv6-related. Can you force ipv4 by adding a "-4" flag to your command and see if this is going to work?

Also, run the following command and show the output:

Code: Select all

nc -zv <Website_URL> 443
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mrochelle
Posts: 238
Joined: Fri May 04, 2012 11:20 am
Location: Heart of America

Re: check_http CRITICAL - Socket timeout

Post by mrochelle »

The -4 made no difference.
However, I ran the command requested nc -zv dns.websitename.com 443
Warning: Inverse name lookup failed for `xxx.xx.xxx.xx' ?
dns.websitename.com [xxx.xx.xxx.xx] 443 (https): Connection timed out

You may be on to something here? School me :idea:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http CRITICAL - Socket timeout

Post by scottwilkerson »

just to make sure this still isn't an IPv6 thing.

Did you run the command from the command line like so?

Code: Select all

cd /usr/local/nagios/libexec
./check_http -H dns.websitename.com -S -4

Also, can you run the following from the commandline successfully?

Code: Select all

curl https://dns.websitename.com
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mrochelle
Posts: 238
Joined: Fri May 04, 2012 11:20 am
Location: Heart of America

Re: check_http CRITICAL - Socket timeout

Post by mrochelle »

Yes, I did run the command as
cd /usr/local/nagios/libexec
./check_http -H dns.websitename.com -S -4

Following is what I get from the curl command:
curl https://dns.websitename.com
curl: (7) couldn't connect to host
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_http CRITICAL - Socket timeout

Post by lmiltchev »

It seems like you cannot connect to this website from your machine. You should've seen some html output, etc. Try running this (for comparison):

Code: Select all

curl https://www.amazon.com
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mrochelle
Posts: 238
Joined: Fri May 04, 2012 11:20 am
Location: Heart of America

Re: check_http CRITICAL - Socket timeout

Post by mrochelle »

curl https://www.amazon.com
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.amazon.com/">here</a>.</p>
</body></html>

I get a similar output for the other servers that work ok.
:idea: OK, working with you has turn the lights on. You are definitely correct. I was confusing the fact I could access the server via my browser which is from a different machine. I'll follow up with my network team and to resolve.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http CRITICAL - Socket timeout

Post by scottwilkerson »

Sounds good...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked