-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dev.icinga.com #7579] only notify users on recovery which have been notified before (not-ok state) #2197
Comments
Updated by mfriedrich on 2014-11-09 18:31:48 +00:00
|
Updated by mfriedrich on 2014-11-09 18:34:46 +00:00
|
Updated by mfriedrich on 2014-11-09 18:34:58 +00:00
|
Updated by mfriedrich on 2014-11-09 18:35:50 +00:00
Use the updated test script. Test against unpatched Icinga 2debug.log
notifications.log
Proposed fixThe state isn't important, or the state change. The notification object just stores which users have been notified, similar to what is sent to db_ido for notification history. Once a recovery happens, the to-be-notified users are checked against the list of notified users. If they match, all good, get their recovery. If not, the notification is skipped. After notifying all users, the list is being reset. We'll use a set of user names here, maybe there are better solutions. Test the fixSame configuration, same input, different code. debug.log
notifications log
There also is a problem with type = Recovery, and missing OK state filter. That's handled in #7623 |
Updated by Anonymous on 2014-11-09 18:55:05 +00:00
Applied in changeset 885e770. |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/7579
Created by mfriedrich on 2014-11-05 09:20:21 +00:00
Assignee: mfriedrich
Status: Resolved (closed on 2014-11-09 18:55:05 +00:00)
Target Version: 2.2.0
Last Update: 2014-11-09 18:55:05 +00:00 (in Redmine)
Problem description
Nagios and Icinga 1.x use the direct host/service~~contact relationship. When a notification is sent for a hard state change, the core stores that information as service~~>notified_on_$state. That may change on NOT-OK from critical to warning, to unknown, and vice versa. Users will get notified if their notification filter can be passed.
Once the host/service recovers from a problem state (not-ok -> ok transition, triggers a hard state change and a notification again).
Steps to reproduce with Nagios/Icinga 1.x
Install Nagios 3.5.1 into /tmp/nagios3/install
Add the attached configuration into the newly created config dir and include it in nagios.cfg (attached as well).
Call the test runner sending passive check results
Run nagios in foreground with "run_trivago_nagios".
Put the test script somewhere and call it.
Check /tmp/nagios3/install/var/trivago.log for the log-notifications command putting all information.
Reprudoce with Icinga 2.x
Conclusion
While it's reasonable to store only the state where this host/service was notified in, the problem is different in Icinga 2.x: The notification object needs to store which user has been notified for which problem state in the past (only the last not-ok state is important). By matching the user it will only send recoveries to that specific user, if a problem notification occured before. Nagios/Icinga1 do not store the contact, but only check if someone was notified ($count > 0).
On Recovery, the "notified user on state" history must be reset.
Proposed Fix
2 stages of notification types and recoveries
Notifications:
Users:
Attachments
Changesets
2014-11-09 18:47:24 +00:00 by (unknown) 885e770
2014-11-14 17:11:58 +00:00 by (unknown) f73d696
Relations:
The text was updated successfully, but these errors were encountered: