Page 1 of 1
check_http CRITICAL - Socket timeout
Posted: Wed Jul 18, 2012 1:35 pm
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.
Re: check_http CRITICAL - Socket timeout
Posted: Wed Jul 18, 2012 2:38 pm
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
Re: check_http CRITICAL - Socket timeout
Posted: Wed Jul 18, 2012 3:22 pm
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.
Re: check_http CRITICAL - Socket timeout
Posted: Thu Jul 19, 2012 9:50 am
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:
Re: check_http CRITICAL - Socket timeout
Posted: Thu Jul 19, 2012 12:07 pm
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

Re: check_http CRITICAL - Socket timeout
Posted: Thu Jul 19, 2012 12:34 pm
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?
Re: check_http CRITICAL - Socket timeout
Posted: Thu Jul 19, 2012 7:12 pm
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
Re: check_http CRITICAL - Socket timeout
Posted: Fri Jul 20, 2012 9:09 am
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):
Re: check_http CRITICAL - Socket timeout
Posted: Fri Jul 20, 2012 11:27 am
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.

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.
Re: check_http CRITICAL - Socket timeout
Posted: Fri Jul 20, 2012 2:25 pm
by scottwilkerson
Sounds good...