Expected 404 in http active check should not be marked as WARN

CMK version:
Checkmk Raw Edition 2.1.0p22

OS version:
Ubuntu 22.04.2 LTS

Hello,

I have an active check on a specific URL. The url gets redirected so I initially get a 302. After authentication, I expect a “404 Not Found”. The check is working as expected, I receive the 404 but the check is marked as WARN. I need it to be marked as OK.
On this forum, I have read a work around this is to go to edit the rule and on “Strings to expect in server response” add the 404. The problem I get, is that the check will fail because it initially gets a 302, and right after that, the condition “Strings to expect in server response” is evaluated and it fails, because a 404 is not return but a 302. Does anyone know how to make the check display OK if 404 is returned after redirection?

Thank you.

I´m thinking about two ways:

  1. Set the parameter “How to handle redirect” to “Make check OK”
  2. Either “Fixed string to expect in the content” or “Regular expression to expect in content” could be configured so that its matching the 404 error displayed on the site? In this case, “How to handle redirect” has to be set to “Follow the redirection” i think

Would one of these work for you?

Thank you. The redirection was happening because I was calling an https site with http. Once I actiavted SSL in the rule, the redirection was not there anymore and I could work with the 404 directly.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.