CRITICAL - Socket timeout after 10 seconds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

I found another post about this, but it doesn't seem to be a firewall issue or anything like that. I'm trying to monitor a web url, and was given a dev site and a prod site to monitor. The dev site is fine, but the prod site will not connect for some reason. The service check is perpetually pending and the host status is always "CRITICAL - Socket timeout after 10 seconds". Any suggestion as to what might be causing this would be very appreciated! Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: CRITICAL - Socket timeout after 10 seconds

Post by scottwilkerson »

From the production server can you reach the URL with curl without errors?

Code: Select all

curl -vvv "https://host.domain.com/path/to/page.php"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

I get an HTTP 302 response, but it says it's connecting to the url, yes.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: CRITICAL - Socket timeout after 10 seconds

Post by npolovenko »

@andrewatmacys, That means the page is redirecting. You can try adding -f ok at the end of your command.
Also, please run your command from the command line and share the output+the whole command syntax with us.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

I edited out the specific IPs and server names, but here is the output:

[user@server ~]$ [user@server ~]$ curl -vvv "http://url" -f ok
-bash: [user@server: command not found
[user@server ~]$ * About to connect() tohost port 80 (#0)
-bash: syntax error near unexpected token `('
[user@server ~]$ * Trying ip_address... connected
-bash: Accept:: command not found
[user@server ~]$ * Connected tohost (ip_address) port 80 (#0)
-bash: syntax error near unexpected token `('
[user@server ~]$ > GET / HTTP/1.1
-bash: /: is a directory
[user@server ~]$ > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
-bash: syntax error near unexpected token `('
[user@server ~]$ > Host:host
-bash:host: command not found
[user@server ~]$ > Accept: */*
-bash: */*: No such file or directory
[user@server ~]$ >
-bash: syntax error near unexpected token `newline'
[user@server ~]$ < HTTP/1.1 302 Found
-bash: HTTP/1.1: No such file or directory
[user@server ~]$ < Cache-Control: private
-bash: Cache-Control:: No such file or directory
[user@server ~]$ < Content-Type: text/html; charset=utf-8
-bash: Content-Type:: No such file or directory
[user@server ~]$ < Location: /Redirect?ReturnUrl=%2f
-bash: Location:: No such file or directory
[user@server ~]$ < Server: Microsoft-IIS/8.0
-bash: Server:: No such file or directory
[user@server ~]$ < X-AspNetMvc-Version: 5.2
-bash: X-AspNetMvc-Version:: No such file or directory
[user@server ~]$ < X-AspNet-Version: 4.0.30319
-bash: X-AspNet-Version:: No such file or directory
[user@server ~]$ < X-Powered-By: ASP.NET
-bash: X-Powered-By:: No such file or directory
[user@server ~]$ < Date: Wed, 18 Apr 2018 18:30:07 GMT
-bash: Date:: No such file or directory
[user@server ~]$ < Content-Length: 140
-bash: Content-Length:: No such file or directory
[user@server ~]$ <
-bash: syntax error near unexpected token `newline'
[user@server ~]$ <html><head><title>Object moved</title></head><body>
-bash: syntax error near unexpected token `<'
[user@server ~]$ <h2>Object moved to <a href="/Redirect?ReturnUrl=%2f">here</a>.</h2>
-bash: syntax error near unexpected token `newline'
[user@server ~]$ </body></html>
-bash: syntax error near unexpected token `<'
[user@server ~]$ * Connection #0 to hosthost left intact
-bash: Accept:: command not found
[user@server ~]$ * getaddrinfo(3) failed for ok:80
-bash: syntax error near unexpected token `('
[user@server ~]$ * Couldn't resolve host 'ok'
> * Closing connection #1
> curl: (6) Couldn't resolve host 'ok'
-bash: Accept:: command not found
[user@server ~]$ * Closing connection #0
-bash: Accept:: command not found
[user@server ~]$ curl -vvv "http://url" -f ok
* About to connect() tohost port 80 (#0)
* Trying ip_address... connected
* Connected tohost (ip_address) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host:host
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Location: /Redirect?ReturnUrl=%2f
< Server: Microsoft-IIS/8.0
< X-AspNetMvc-Version: 5.2
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
< Date: Wed, 18 Apr 2018 18:32:18 GMT
< Content-Length: 140
<
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Redirect?ReturnUrl=%2f">here</a>.</h2>
</body></html>
* Connection #0 to hosthost left intact
* getaddrinfo(3) failed for ok:80
* Couldn't resolve host 'ok'
* Closing connection #1
curl: (6) Couldn't resolve host 'ok'
* Closing connection #0
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: CRITICAL - Socket timeout after 10 seconds

Post by npolovenko »

@ andrewatmacys. Sorry, I meant adding the redirect flag to the check_http command, not to the curl command.
Can you go to the core configurations manager, then services, and find this service check that is timing out after 10 seconds. Click on it and send us a screenshot of the whole page, so that we can see all arguments, the command and everything else.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

Sorry for the delay, things have been extremely busy.

Here is the picture you asked for!
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: CRITICAL - Socket timeout after 10 seconds

Post by npolovenko »

@andrewatmacys, Please add -t 30 at the end of the $ARG1$ field. Save the config, then click on the Apply Configuration in the left column. Let me know if you still get a timeout error after that, and whether it says "Socket timed out after 30 seconds" now.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

I'm still getting a socket timeout of ten seconds, but it's on the host. If I look at the list of hosts, it tells me the service check is pending, but the host is highlighted red and says it's timing out after 10 seconds.

If I run check command, it gives me an http 302 found status. But it does not show the check running outside of testing the check command.
andrewatmacys
Posts: 114
Joined: Tue Feb 06, 2018 9:25 am

Re: CRITICAL - Socket timeout after 10 seconds

Post by andrewatmacys »

It is likely worth noting that on a separate instance of monitoring the dev url, adding the -t 30 does not return anything at all.
Locked