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
web content check unexpected behaviour
-
manish2tiwari
- Posts: 31
- Joined: Thu Sep 13, 2012 12:48 pm
Re: web content check unexpected behaviour
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.
I use the "-S" switch to affirmatively match text that should appear on the website but that doesn't appear on my maintenance page.
-
manish2tiwari
- Posts: 31
- Joined: Thu Sep 13, 2012 12:48 pm
Re: web content check unexpected behaviour
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
check_xi_service_http!-s "<keyword to match>" -H <site name> -f ok -I <server IP> -u "<URL>" -p 80 -a "<credentials>"
Thanks
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: web content check unexpected behaviour
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
-f is the onredirect command,if you want this to follow you should change
-f ok
to
-f follow
-
manish2tiwari
- Posts: 31
- Joined: Thu Sep 13, 2012 12:48 pm
Re: web content check unexpected behaviour
Thank you Scott, i tested it for few test applications and it worked.
You are a rockstar.
Manish
You are a rockstar.
Manish