I made an integration for checkmk to send host and service alerts to opsgenie, but currently it only alerts for the test service (“filesystem /” critical)
When testing if alerts work, there’s no selector to select where to send the alert, it seems to default to slack for some reason ?
So do i need separate alert rule for each alert type ? and what is the correct way to get the host alerts forwarded ? we have a rule for slack alerts that just includes everything and that works fine
In my opinion, the alert rules should ignore the service filter in the case of a host event, as it is not a service event. This seems to me to be a misbehaving of Checkmk.
Have a look at ~/var/log/notify.log on the site that the host is monitored . There you should be able to analyze why a rule triggers or does not trigger. Prior you should have named all notification rules to ease analyzing the log file.
2025-02-16 21:10:05,348 [20] [cmk.base.notify] Got raw notification (server1i;Check_MK Discovery) context with 73 variables
2025-02-16 21:10:05,350 [15] [cmk.base.notify] Global rule 'prod and limbo db basic opsgenie alerts'...
2025-02-16 21:10:05,350 [15] [cmk.base.notify] -> does not match: The host's name 'be57.apix.fi' is not on the list of allowed hosts (server2, server3)
2025-02-16 21:10:05,350 [15] [cmk.base.notify] Global rule 'Notify all contacts of a host/service via HTML email'...
2025-02-16 21:10:05,350 [15] [cmk.base.notify] -> does not match: The service's description 'Check_MK Discovery' does not match by the list of allowed services (Filesystem /)
2025-02-16 21:10:05,350 [15] [cmk.base.notify] Global rule 'Notify jere of a host/service via HTML email'...
2025-02-16 21:10:05,350 [15] [cmk.base.notify] -> does not match: The service's description 'Check_MK Discovery' does not match by the list of allowed services (check_limbo_locked.pl)
2025-02-16 21:10:05,350 [15] [cmk.base.notify] Global rule 'Notify all contacts of a host/service via HTML email'...
2025-02-16 21:10:05,350 [15] [cmk.base.notify] -> does not match: Event type 'wr' not handled by this rule. Allowed are: rc, ru, wc, wu, cr, cu, ur, uc, s, x, as, af
2025-02-16 21:10:05,350 [20] [cmk.base.notify] No rule matched, would notify fallback contacts, but none configured
Could this be the problem ?
does not match: The service’s description ‘Check_MK Discovery’ does not match by the list of allowed services (Filesystem /)
No, that’s a different rule my colleague was testing.
The one I was talking about is the one with filesystem service check and what I thought was all host statuses going down or unreachable but it seems host alert also needs a service ?
Clone that rule, the first rule you use for host notifications and select all the filters that you find useful while in the second one you use for service notifications and apply all filters that are useful for you.
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.