Page 1 of 1

web content check unexpected behaviour

Posted: Wed Sep 26, 2012 4:47 am
by manish2tiwari
Hi Friends,

Yesterday we observed an unexpected behavior from web page content check service of Nagios website Monitoring:

We were monitoring one of our internet site and were having some web content check on the same, when the site was down we were redirecting the site to some other working site, in this case we were expecting that web content check will fail as the redirected site doesn't contains the searched content.

But the web content service were showing 302 redirects with the Green Status as OK, which failed our test case as the site itself was down.

Similar thing was happening with http check for the same website as it was also showing 302 redirect with status OK, but the actual website was down.

Could you please let me know if we can avoid this situation.

Thanks,
Manish

Re: web content check unexpected behaviour

Posted: Wed Sep 26, 2012 9:53 am
by CGraham
Post the command you're using for your web check. If you have the "-f" switch, it will follow your redirect and still possibly give an OK.

I use the "-S" switch to affirmatively match text that should appear on the website but that doesn't appear on my maintenance page.

Re: web content check unexpected behaviour

Posted: Wed Sep 26, 2012 11:31 am
by manish2tiwari
Below is the command i used:

check_xi_service_http!-s "<keyword to match>" -H <site name> -f ok -I <server IP> -u "<URL>" -p 80 -a "<credentials>"

Thanks

Re: web content check unexpected behaviour

Posted: Wed Sep 26, 2012 5:15 pm
by scottwilkerson
You have the -f ok flag set.

-f is the onredirect command,if you want this to follow you should change
-f ok

to

-f follow

Re: web content check unexpected behaviour

Posted: Thu Sep 27, 2012 10:45 am
by manish2tiwari
Thank you Scott, i tested it for few test applications and it worked.

You are a rockstar. :)

Manish