Check_http and redirection

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Koobal
Posts: 20
Joined: Mon Sep 03, 2012 7:26 am

Check_http and redirection

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Check_http and redirection

Post 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?
Former Nagios employee
Koobal
Posts: 20
Joined: Mon Sep 03, 2012 7:26 am

Re: Check_http and redirection

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Check_http and redirection

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Koobal
Posts: 20
Joined: Mon Sep 03, 2012 7:26 am

Re: Check_http and redirection

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Check_http and redirection

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked