Fake Check Result not creating notification

I am trying to test a rule based notification, I do fake check result on service but it does not fire notification, it is not poping up in notifications analysis tab. Any ideas? custom notification works but ignores rule

Most likely your “Maximum number of check attempts” is set to 3 or something. In this case you have to fake the check result 3 times in a row before the service wents from soft into hard state.
only services in hard state get notified.

Check the service view if the check for something like:

Current check attempt 1/3

You could configure “Maximum number of check attempts” for this service to 1 and then the fake check results should immediately got to hard state and notify.

1 Like

By the way, there is a feature request, that fake check result should directly create a hard state, so a notification is triggered.

Regards, Christian

I think would be a “very stupid” thing. With this you would have different types of checks/check results.
Why? Is it too much to disable the active check corresponding to the check you want the fake check result for?

1 Like

@mimimi tried it, I see after 3 attempts it gets to HARD state but still not notification, like I cant see it in notification analysis. Is there other way to test rule based notifications? custom notifications ignores rules

Perhaps this Video is helpfull:

Episode 21: Setting up notifications in Checkmk

  • Make sure you do not have a rule for “Delay service notifications”.
  • Make sure you do not have a rule for “Enable/disable notifications for services”
  • Check ~/var/log/notify.log on the site.
tail -f ~/var/log/notify.log
less ~/var/log/notify.log

This document explains how to increase the log level:

Well since notifications not created I dont think notify logs can help, but I checked above rules and they look fine. This system is around for long years and most probably there is some kind of rule causes it. I almost gave up with fake checks, no other way to check rule? maybe some cmk command to fire test notification?

When I debug notifications, I usually set up a passive check with the “Integrate Nagios plugins” rule.

I just give it a Service description of “test notification” and as condition use the folder I want to test.

After activating the config every host matched by the condition
now also has a passive check called “test notification” which is in state pending (PEND).

Now you can easily fake check results on that “test notification” service.

It will become stale but if you set up a rule “Normal check interval for service checks”: Service name begins with “test notification” 9999 days it won’t.

Then I create a ~/local/share/check_mk/notifications/debug.sh in the site:

#!/bin/bash
# debug
logger "$0 $*"
printenv > /tmp/debug.$$.env
exec > /tmp/debug.$$.log 2>&1
echo hello

Now you can use the debug script as notification method in your notification rule and watch the files in /tmp

BTW: There is also a sidebar element called “Master control”
where notifications can be disabled globally, is this enabled ?

1 Like

Thank you, it was because of “Notified events for services” rule. I needed explicit rule for folder to make notifications work. As I said there are a lot of rules added before me and I had no idea about this rule.

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.