Delegate notifications master/satellite

Hi all. I’m just configuring a three level Icinga2 monitoring solution:
1 master <-> 1 satellite <-> clients
I want to know if I can handle the notifications from stellite in some zones and others from master.
For example, zone 1 has to send notifications from satellite but not from master, and for zone 2 the satellite has not to be able to send notifications but the master.
It’s this possible?

Thanks you.

Why do you want to send notifications from a zone? I prefer a HA-Cluster with two masters, which able to send notifications.

Hi,

with some advanced configuration techniques, this should be possible. I would advise against this, since you may encounter problems with missing notifications if for example the satellite zone goes down entirely. At least you should setup health checks from the master zone to the satellite zone and add notifications for them.

In terms of notification apply rules and specific notification settings being enabled, you could try the following:

apply Service "satellite-check" {

  if (host.zone == "satellite-zone-name") {
    enable_notifications = true
  } else {
    enable_notifications = false
  }

  assign where ... // host in a satellite zone matches
}

Problem I do see here is that this won’t work for hosts. Another method would be to have the notifications off by default for host/service objects defined on the master, then let the config sync happen to the satellite. A script modifying the enable_notifications attribute to true via the REST API for all satellite host/service objects should work as well. This would also be a slightly better approach to e.g. turn off satellite notifications off and on on-demand, e.g. when you decide that the master should turn over the notifications.

Cheers,
Michael

Thanks for you replies.
The objective is to set up a distributed monitoring among different customers. Each customer will be a zone in icinga and some customers will have their own ticket system, so for some customers I need to delegate the notification feature enabled in the satellite because they have their own ticket system inside their infrastructure, and for other with no ticket system the master will handle their notifications.
I will try different approach based in you comments and I will post later how I’ll finally configured it.
Thanks a lot.

I use this configuration for a similar approach:

apply Notification "..." to Service {
   ...
   assign where ... && host.zone == ZoneName
}
2 Likes

Ah, that’s even better! Forget my proposals and use this. I’m a little tired this week after giving a training :slight_smile:

I remember your fatigue after my training in 2017 :smile:

1 Like

Seems to me that the suggested configuration will only cause the Notification to fire only for the selected zone. But the notification command will still be executed on the master instead of the satellite.

I in my setup require a way to execute notification commands inside the zone, on the satellite, which is a separate network environment to the master. So far I was unable to find a way to do this.

Welcome to the Icinga community.

I’ve just verified again and master as well a satellites are only sending notifications for their objects. All instances use their locally installed MTA.

There might be a mistake within your config? Maybe the ZoneName const in constants.conf is wrong. You could verify your objects e.g.:

icinga2 object list -t notification | grep Object

on every node. Each node should only have notification objects for their own host objects.