Doppel Benachrichtigung

Hallo,

ich habe das Problem, dass ich immer alle Benachrichtigungen doppelt bekomme, wobei die Regeln dabei verschiedene sein können.
In /var/log/notify.log ist zu erkennen, dass auch 2 “Got raw notification” mit Abstand von 2 Sek. mit dem gleichen Inhalt auftauchen.

Ich hatte jetzt schon eine Fallback E-Mail-Adresse gesetzt und Zuweisung an explizite User und E-Mail Adressen probiert.
Aber ich gehe nicht davon aus, dass es daran liegt, wenn in der notify.log 2 Nachrichten drin stehen.

Habt ihr eine Idee wo ich suchen kann?

Untested on my side, but docs article Notification basics chapter 5 Error diagnosis in the Nagios monitoring core suggests to check ~/var/nagios/debug.log.
File which will be created if you set the debug_level variable to 32 in etc/nagios/nagios.d/logging.cfg, and restart the core.

Danke Yggy, Log ist umgestellt.

Hier mal ein Event, was mit E-Mail an die Fallback-EMail-Adresse gegangen ist.

Auffällig hier: “2 contacts were notified” ← Fallback ist aber nur eine Adresse

und “Last Notification: Thu Jan 1 01:00:0”

[1786465656.108733] [032.0] [pid=1837555] ** Service Notification Attempt ** Host: 'Backup-PBS', Service: 'APT Updates', Type: 0, Options: 0, Current State: 2, Last Notification: Thu Jan  1 01:00:0>
[1786465656.1A08812] [032.0] [pid=1837555] Notification viability test passed.
[1786465660.874356] [032.0] [pid=1837555] 2 contacts were notified.  Next possible notification time: Tue Aug 11 18:27:36 2026
[1786465660.874415] [032.0] [pid=1837555] 2 contacts were notified.

Looks like in some rule another contact is defined.

In ~/var/log/notify.log it should list what rules a raw notification triggers and which rule (doesn’t) match. Then check the matched rules if contact conditions are set.

Alternatively, from the other way around, maybe the mail address of second contact can be found by doing a grep for all files in ~/etc/check_mk/conf.d/wato/, like @andreas-doehler suggested here to find an old tag in an unknown rule: Find unknown tags / no longer existing tags in rules - #2 by andreas-doehler

Regarding last notification, I assume there was no last notification, so it takes 0 as Unix timestamp. Time zero was on Thursday, January 1, 1970 00:00:00 UTC, but in your timezone probably +1.

Für mich sieht es fast so aus, als wenn es nicht ein Benachrichtigungsproblem ist, sondern eher ein Eventproblem.
Das eventuell alle Events doppelt erkannt werden und somit auch die Benachrichtigungen doppelt sind.

Ich habe eine E-Mail-Adresse eingegeben, die noch nicht im System ist. Woher soll er den 2. Kontakt nehmen?

Hier mal ein Event aus ~/var/log/notify.log

2026-08-13 08:34:34,935 [20] [cmk.base.notify] Got raw notification (Luna;NTP Time) context with 93 variables
2026-08-13 08:34:34,935 [15] [cmk.base.notify] Global rule ‘Benachrichtigungen für SPAM’…
2026-08-13 08:34:34,935 [15] [cmk.base.notify] → does not match: The host’s name ‘Luna’ is not on the list of allowed hosts (Exchange2019)
2026-08-13 08:34:34,936 [15] [cmk.base.notify] Global rule ‘Benachrichtigungen für Temperaturen’…
2026-08-13 08:34:34,936 [15] [cmk.base.notify] → does not match: The service labels {‘service’: ‘temperatur’} did not match {}
2026-08-13 08:34:34,936 [15] [cmk.base.notify] Global rule ‘Notify all contacts of a host/service via HTML email’…
2026-08-13 08:34:34,936 [15] [cmk.base.notify] → does not match: This rule is disabled
2026-08-13 08:34:34,936 [15] [cmk.base.notify] Global rule ‘Host Status’…
2026-08-13 08:34:34,936 [15] [cmk.base.notify] → does not match: This is a service notification, but the rule just matches host events
2026-08-13 08:34:34,936 [20] [cmk.base.notify] No rule matched, notifying fallback contacts
2026-08-13 08:34:34,936 [20] [cmk.base.notify] Sending email to [‘Hans@Wurst.de’]
2026-08-13 08:34:34,936 [20] [cmk.events.log_to_history] sending command LOG;SERVICE NOTIFICATION: ``mailto:Hans@Wurst.de``;Luna;NTP Time;WARNING;asciimail;Offset: 935.3520 ms (warn/crit at 8>
2026-08-13 08:34:34,937 [20] [cmk.base.notify] executing /omd/sites/checkmk/share/check_mk/notifications/asciimail
2026-08-13 08:34:35,634 [20] [cmk.base.notify] Output: Spooled mail to local mail transmission agent
2026-08-13 08:34:35,747 [20] [cmk.events.log_to_history] sending command LOG;SERVICE NOTIFICATION RESULT: ``mailto:Hans@Wurst.de``;Luna;NTP Time;OK;asciimail;Spooled mail to local mail transm>
2026-08-13 08:34:37,254 [20] [cmk.base.notify] ----------------------------------------------------------------------
2026-08-13 08:34:37,254 [20] [cmk.base.notify] Got raw notification (Luna;NTP Time) context with 93 variables
2026-08-13 08:34:37,254 [15] [cmk.base.notify] Global rule ‘Benachrichtigungen für SPAM’…
2026-08-13 08:34:37,254 [15] [cmk.base.notify] → does not match: The host’s name ‘Luna’ is not on the list of allowed hosts (Exchange2019)
2026-08-13 08:34:37,254 [15] [cmk.base.notify] Global rule ‘Benachrichtigungen für Temperaturen’…
2026-08-13 08:34:37,254 [15] [cmk.base.notify] → does not match: The service labels {‘service’: ‘temperatur’} did not match {}
2026-08-13 08:34:37,254 [15] [cmk.base.notify] Global rule ‘Notify all contacts of a host/service via HTML email’…
2026-08-13 08:34:37,254 [15] [cmk.base.notify] → does not match: This rule is disabled
2026-08-13 08:34:37,255 [15] [cmk.base.notify] Global rule ‘Host Status’…
2026-08-13 08:34:37,255 [15] [cmk.base.notify] → does not match: This is a service notification, but the rule just matches host events
2026-08-13 08:34:37,255 [20] [cmk.base.notify] No rule matched, notifying fallback contacts
2026-08-13 08:34:37,255 [20] [cmk.base.notify] Sending email to [‘Hans@Wurst.de’]
2026-08-13 08:34:37,255 [20] [cmk.events.log_to_history] sending command LOG;SERVICE NOTIFICATION: ``mailto:Hans@Wurst.de``;Luna;NTP Time;WARNING;asciimail;Offset: 935.3520 ms (warn/crit at 8>
2026-08-13 08:34:37,255 [20] [cmk.base.notify] executing /omd/sites/checkmk/share/check_mk/notifications/asciimail
2026-08-13 08:34:38,028 [20] [cmk.base.notify] Output: Spooled mail to local mail transmission agent
2026-08-13 08:34:38,117 [20] [cmk.events.log_to_history] sending command LOG;SERVICE NOTIFICATION RESULT: ``mailto:Hans@Wurst.de``;Luna;NTP Time;OK;asciimail;Spooled mail to local mail transm>

Wenn du zweimal hintereinander das gleiche Event bekommst würde ich hier erstmal im Core Log schauen warum. Die Events welche hier ankommen müssen ja vom Core erstmal generiert werden.
Das die Mail danach zweimal an den Fallback Contact geht ist wiederrum dann ja richtig.

Problem gelöst.

Ich hatte folgendes in meiner ~/var/nagios/nagios.log.
[1786638931] SERVICE ALERT: USVpi;Check_MK;OK;HARD;1;[agent] Success, [piggyback] Success (but no data found for this host), execution time 46.5 sec
[1786638931] SERVICE NOTIFICATION: service;USVpi;Check_MK;OK;check-mk-notify;[agent] Success, [piggyback] Success (but no data found for this host), execution time 46.5 sec
[1786638933] SERVICE NOTIFICATION: check-mk-notify;USVpi;Check_MK;OK;check-mk-notify;[agent] Success, [piggyback] Success (but no data found for this host), execution time 46.5 sec

Hierbei ist “service” ein Nutzer, der schon seit mehreren Jahren und Versionen existiert.
Regeln gab es für ihn nicht und Benachrichtigungen in den User Einstellungen deaktivieren hat auch nicht geholfen.

Dieser wurde gelöscht und wieder neu erstellt.

Danke und bis zum nächsten Problem.