Icinga / Icinga/icinga2

Acknowledgement notifications are not sent if type filter in Notification object does not contain Problem

Open
#9,739 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/notifications bug
Dominant language
C++
Stars
2.2k
Forks
616
Avg merge
5d 6h
Merged PRs (30d)
10

Description

Describe the bug

When creating a Notification object with types = [ Acknowledgement ], no acknowledgement notifications are sent. Setting the same type filter in a User object instead sends these notifications.

To Reproduce

Sample config:

object User "dummy" {}

object NotificationCommand "true" {
	command = ["true"]
}

apply Notification "notify-acks" to Service {
	command = "true"
	types = [ Acknowledgement ]
	users = [ "dummy" ]
	assign where true
}
  1. Bring a checkable into a problem state.
  2. Acknowledge it.
  3. Observe that no notification is sent.

Expected behavior

An acknowledgement notification should be sent.

Cause

The notification is not sent because of the following check:
https://github.com/Icinga/icinga2/blob/66b039df9c5460bcd4db4c4774e09a1ba8ca075b/lib/icinga/notification.cpp#L432-L440

Workaround

(Additionally) add types = [ Acknowledgement ] to the User object, then it will skip this check due to the NotificationProblem & user->GetTypeFilter() condition.

Suggested fix

Probably the type filter check should be done for this (i.e. the Notification object) just like it's already done for user.

Your Environment

  • Version used (icinga2 --version): current master (66b039df9c5460bcd4db4c4774e09a1ba8ca075b)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/icinga/notification.cpp at the check around lines 432-440, then reproduce the issue with the Notification configuration and acknowledgement steps shown above. Done means an acknowledgement notification is sent when the Notification object has types = [ Acknowledgement ], without requiring the same filter on the User object.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.