Page 1 of 2
CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Mon Apr 11, 2016 9:30 am
by Brooks
Hello,
We have a few websites that we monitor. We create the notification function using the core configuration wizard and choosing the "Monitor A website" and from the list of monitoring function we choose "http" and deselect everything else. There is one site that works for awhile and then for some reason (because we can connect to the url with no issues) reports the following error:
CRITICAL - Socket timeout after 10 seconds
Service:HTTP
Host: (host name)
- this site does redirect to https. Is this why? I do add the site as an https link but choose the http as the option to monitor (my only goal is to verify when the site goes down and you cannot connect to the
https://link)
- I've tried removing this from nagios and adding back several times but still get the error even though I can connect to the site.
Any thoughts for why we get this error if the site is not down?
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Mon Apr 11, 2016 10:45 am
by hsmith
Are you checking the box that says 'Use SSL/TLS' on the wizard? This may be required for you.
My tests worked both ways - I'm redirecting traffic from port 80 to port 443 using nginx in my configuration.
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Mon Apr 11, 2016 11:05 am
by Brooks
Yes I've been using that setting. I'll give this one more shot and if I get the error again I will repost with some print screens.
Thanks
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Mon Apr 11, 2016 1:39 pm
by hsmith
Sounds good. Let us know what you come up with.
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Fri Apr 22, 2016 7:43 am
by Brooks
Unfortunately I continue to get these errors intermittently telling me the site is down (but it's not - I can connect to the url with no issues). This is falsely reporting something. The message will mysteriously go away and tell me the site is up then go back down again with the following error message (what is this socket time out error?):
Nagios has detected a problem with this host.
Notification Type: PROBLEM
Host: (Hostname)
State: DOWN
Address: website-url-name
Info: CRITICAL - Socket timeout after 10 seconds
- I know that I'm setting this up correctly and I've tried a few different ways (leaving out the https as well as checking the https)
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Fri Apr 22, 2016 1:51 pm
by tmcdonald
Is there any sort of proxy or load-balancer in your environment between Nagios and the remote machine? Any firewall, IDS/IPS, anything like that which might be inspecting/touching the traffic?
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Fri Apr 22, 2016 1:57 pm
by Brooks
nothing
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Fri Apr 22, 2016 2:04 pm
by tmcdonald
Can you post the service definition for this check? In the CCM, find the service and then click the "View Text Config" diskette button and paste that here (sanitize if needed, but please point out where this is done).
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Fri Apr 22, 2016 2:10 pm
by Brooks
###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date: 2016-04-22 15:08:23
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################
define service {
host_name (hostname)
service_description HTTP
use xiwizard_website_http_service
check_command check_xi_service_http! -f ok -I xx.xx.xx.xxx -u "/" -S -p 443
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts
_xiwizard website
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
Re: CRITICAL Socket Timeout Errors When Monitoring HTTP Site
Posted: Sat Apr 23, 2016 6:46 pm
by rkennedy
Does the site have multiple IP's in use? I just tested your command on my end, and it's working fine provided the IP is correct. The site could be using SNI on a load balancer, what happens if you append
--sni?
Here's what I ran on my end -
Code: Select all
[root@localhost libexec]# ./check_http -H google.com -f ok -I 216.58.192.174 -u "/" -S -p 443
HTTP OK: HTTP/1.1 301 Moved Permanently - 654 bytes in 0.111 second response time |time=0.111431s;;;0.000000 size=654B;;;0