May be default conf.d/notifications.conf config can help you:

#apply Notification "mail-icingaadmin" to Service {
#  import "mail-service-notification"
#  user_groups = host.vars.notification.mail.groups
#  assign where host.vars.notification.mail
#}

apply Notification "slack-icingaadmin" to Host {
  import "slack-host-notification"
  assign where host.vars.notification.slack
  user_groups = host.vars.notification.slack.devops_channel
}

My example is for slack, but you can see, that email notifications doing the 
same way.

In example we notificate on events if exist host var notification.slack
and send this message to a host var notification.slack.devops_channel

Example template generic host is:
template Host "generic-LinuxHost" {
...
    vars.notification["mail"] = {
        /* The UserGroup `icingaadmins` is defined in `users.conf`. */
        groups = [ "icingaadmins" ]
    }

    vars.notification["slack"] = {
        devops_channel = [ "icingaadmins" ]
    }
}

If you want to separate notification - just assign different groups to 
different services or hosts.

08.09.2015, 14:31, "Bertalan Voros" <bertalan.vo...@gmail.com>:
> Hello All,
>
> I would like to set up notifications to be sent to various teams based on 
> their interests.
>
> Coudl this be done by setting a variable on hosts/services and then setting a 
> notification that applies to that?
>
> Is there a better way of doing this?
>
> Also how would this have to be done on hosts that are monitored using the 
> Icinga2 agent? Would it have to be defined on the services on the remote host?
>
> Any guidelines and examples would be greatly appreciated.
> ,
>
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users

------
 Романеев Василий
Мобильный: +7-987-636-62-67
skype romaneev
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to