Page 1 of 1

Check_http and redirection

Posted: Wed Feb 05, 2014 12:04 pm
by Koobal
Hello,
I 'd like to check a webservice.
The fact is that webservice is behind Load-balancer and Reverse-proxy.
when I try in a browser https://mywebserviceurl/my/parameters/xx I have some output.
This is that output i'd like to monitor.
When I do a :
check_http -H mywebserviceurl -s "output" -f ok -u '/my/parameters/xx'
I have a HTTP OK - HTTP/1.0 302 Redirect but he didn't check my string.

If I add -S i have a CRITICAL - Socket timeout after 10 seconds, same with -f follow, and same again with both.
I have made a lot of test with different parameters but same results...
Is someone already seen that issue ?

Thanks,
Regards

Re: Check_http and redirection

Posted: Wed Feb 05, 2014 6:03 pm
by tmcdonald
This is a known issue, and we have a dev looking at it. In the meantime can you try using -I (capital i) instead of -H?

Re: Check_http and redirection

Posted: Thu Feb 06, 2014 3:50 am
by Koobal
Hi tmcdonald,
Thanks for your answer.
I tried with just a simple check_http -I myurl and got a 404.
My url is accessible from my nagios (curl myurl is ok).
I thought that -I was for the Public IP... I tried with the IP too, same result.

Re: Check_http and redirection

Posted: Thu Feb 06, 2014 11:32 am
by sreinhardt
I have to finish up one other plugin I am working on presently but than am going to work on this. So to clarify what you are expecting to do, you want to check the redirect from the load balancer, or you want it to redirect to the actual server and check a string on that page but that is not happening? My guess is the latter as checking the load balancer wouldn't seem to make sense.

Re: Check_http and redirection

Posted: Fri Apr 18, 2014 8:41 am
by Koobal
Hi Sreinhardt,
Sorry for the long delay...
I'd like to check the content of the page, not the redirection nor the LB, you're right.
Thanks for your help

Re: Check_http and redirection

Posted: Fri Apr 18, 2014 11:50 am
by sreinhardt
No worries, thanks for the reminder and clarification. I will take a look into how possible this is. If possible, I would really like to test on your environment if it is externally available. Would it be possible for you to PM me an address to check? If not I can try and set up something similar to test with.

edit: You likely need to use -f follow not -f ok, as that will follow the redirect then check the string to make sure everything is as expected.