web content check unexpected behaviour

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

web content check unexpected behaviour

Post 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
User avatar
CGraham
Posts: 115
Joined: Tue Aug 16, 2011 2:43 pm

Re: web content check unexpected behaviour

Post 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.
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

Re: web content check unexpected behaviour

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: web content check unexpected behaviour

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
manish2tiwari
Posts: 31
Joined: Thu Sep 13, 2012 12:48 pm

Re: web content check unexpected behaviour

Post by manish2tiwari »

Thank you Scott, i tested it for few test applications and it worked.

You are a rockstar. :)

Manish
Locked