Icinga2: Notification for confirmed alarms?

Hello all,

I would like to send a notification to a user group via email as soon as I confirm an service problem.

For this I have made the following settings in the Icinga2 Direcor:

apply Notification “Services” to Service {
command = “notify_service_by_mail”
interval = 0s
period = “everytime”
assign where match("*", service.name)
states = [ Critical, OK, Unknown, Warning ]
types = [ Acknowledgement, Custom ] user_groups = [ “Admins” ] }
user_groups = [ “Admins” ]
}

object User “Marco” {
email = “marco@xxx.de
enable_notifications = true
period = “everytime”
states = [ Critical, Down, OK, Unknown, Up, Warning ]
types = [
Acknowledgement,
Custom,
DowntimeEnd,
DowntimeRemoved,
DowntimeStart,
FlappingEnd,
FlappingStart,
Problem,
Recovery
]
groups = [ “Test”, “Admins” ]
}

Now when I confirm a sensor that is in Warning, or Critical status, no notification is sent.

Screenshot 2021-05-27 075613

What do I wrong?

Thx for any help!

Marco

no idea? is the configuration right?

Still the same problem :frowning:

when i acknowlege a critical alarm, in the history I the following message:

this notification was not sent out to any contact

In the log I see following log entry:
[2021-07-29 09:07:44 +0200] information/Checkable: Checkable 'xxxMON1.xxx.local!Sophos Central - Status' has 1 notification(s). Checking filters for type 'Acknowledgement', sends will be logged.
zones.d/master/notification_apply.conf

apply Notification "AcknowledgedService" to Service {
    command = "notify_service_by_mail"
    period = "everytime"
    assign where service.vars.ack_service
    # also try:     assign where service.name
    # also try: assign where match("*", service.name)
    states = [ Critical, OK, Unknown, Warning ]
    types = [ Acknowledgement, Custom ]
    users = [ "Marco" ]
}
zones.d/master/users.conf

object User "Marco" {
    email = "marco@xxx.de"
    enable_notifications = true
    period = "everytime"
    states = [ Critical, Down, OK, Unknown, Up, Warning ]
    types = [
        Acknowledgement,
        Custom,
        DowntimeEnd,
        DowntimeRemoved,
        DowntimeStart,
        FlappingEnd,
        FlappingStart,
        Problem,
        Recovery
    ]
    groups = [ "Admin" ]
}
zones.d/director-global/timeperiods.conf

object TimePeriod "everytime" {
    import "legacy-timeperiod"
    ranges = {
        "friday"	= "00:00-24:00"
        "monday"	= "00:00-24:00"
        "saturday"	= "00:00-24:00"
        "sunday"	= "00:00-24:00"
        "thursday"	= "00:00-24:00"
        "tuesday"	= "00:00-24:00"
        "wednesday"	= "00:00-24:00"
    }
}

If I remember correctly, Icinga will only send acknowledgement notifications if it notified for the problem that is being acknowledged, so that filter might be the cause:

So you could try adding Problem there and see if this also enables ack notifications. I understand that you probably have a reason for not listing problem there but you could at least try to see if that’s the cause. As far as I know, there’s no way to change this behavior right now, unfortunately.

Hi, when I add “Problem” I get everytime a mail, when a sensor change his state to “Critical, Warning, or Unkown”

The subject starts with [problem]…

That shows me that the Benachrichtig basically works?!?

Maybe I should post an error message on github?

Yes, but the important point is “do you now get the Achnowledgement
notifications as well?”

If you don’t want to receive the Problem reports, you can easily filter those
out in your notification sending script.

Antony.

Hello,

first, THANKS FOR ANY HELP HERE!

now the notification works when an alarm is confirmed by email.

But this behavior is not logical for me. I would expect the Acknowlegement type to be sufficient.

How can I filter out the “problem” messages?

Hi,

i create a new issue on github:

Hi,

since last update to icinga 2.13 my problem solved!

:grinning:

1 Like