Page 1 of 1

check_http failing in some cases

Posted: Sun Nov 24, 2013 10:09 pm
by stecino
Hello all,

I am running into an issue, where a simple http check hitting a java process http port fails

Here is the error:
[root@stageutil03 libexec]# ./check_http -H 10.198.6.16 -w 2 -c 4 -u '/datatracker?healthcheck=1' -p 8080
CRITICAL - Socket timeout after 10 seconds

But when I hit this process going through nginx that fronts this, I get 200 ok

[root@stageutil03 libexec]# ./check_http -H 10.198.6.16 -w 2 -c 4 -u '/datatracker?healthcheck=1' -p 8085
HTTP OK: HTTP/1.1 200 OK - 121 bytes in 0.004 second response time |time=0.004273s;2.000000;4.000000;0.000000 size=121B;;;0

And this is the curl command returning the response on the failing port in nagios
[root@stageutil03 libexec]# curl -I http://10.198.6.16:8080//datatracker?healthcheck=1
HTTP/1.1 200 OK
Content-Length: 6

What could be the issue? I have looked at the nrpe client logs, and it's not telling me much

Re: check_http failing in some cases

Posted: Mon Nov 25, 2013 1:36 pm
by sreinhardt
Interesting, have you tried the check_http with double slashes, like in your curl request?

Code: Select all

./check_http -H 10.198.6.16 -w 2 -c 4 -u '//datatracker?healthcheck=1' -p 8080

Re: check_http failing in some cases

Posted: Mon Nov 25, 2013 10:56 pm
by stecino
No go

Re: check_http failing in some cases

Posted: Tue Nov 26, 2013 12:59 pm
by tmcdonald
What happens if you add -N (to ignore the document body) to the failing check? Could be the Java process on port 8080 is just slow. This would also make sense if the curl takes a while to run.

Re: check_http failing in some cases

Posted: Tue Nov 26, 2013 9:21 pm
by stecino
Bingo!!!

[root@stageutil03 libexec]# ./check_http -N -H 10.198.6.16 -w 2 -c 4 -u '/datatracker?healthcheck=1' -p 8080
HTTP OK: HTTP/1.1 200 OK - 44 bytes in 0.003 second response time |time=0.002846s;2.000000;4.000000;0.000000 size=44B;;;0

Why is this?

Re: check_http failing in some cases

Posted: Wed Nov 27, 2013 10:06 am
by tmcdonald
As far as I know, HTTP headers will show up most of the time regardless of the document body. The body can be delayed for various reasons, but the headers are usually instant. The -N flag just checks the headers and ignores the rest.