Add notification result store/sync #6722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Story
Every now and then notifications do not work, and the last resort is the executed command script. Instead of greps inside the icinga2.log, it would be nice to have the results available.
Having an HA enabled zone with two masters also renders this kind of complicated, as notifications run balanced similar to checkables. Some commands are logged on masterA, others on masterB. Synchronising the notification result between them allows us to keep track of it independently.
This also comes to mind with having one backend writer active, while the secondary is paused. Both need to synchronise the notification result event, and then one of them writes that to the backend (IDO won't receive that, just IcingaDB).
Solution
Instead of only logging the executed notification command line (notice level if ok, warning if failed), we want to have the command line available in memory for better analysis and debugging.
Furthermore, we'll need the command line via event available for Icinga DB and store the historical relevant parts next to the notified user, etc.