Hi,

What is in the templates "support-host-notification" and "infra-service-notification"?

I think you only need two apply Notifications - one for hosts and one for services - untested example:

apply Notification to Host {
  import "custom-host-notification"

  user_groups = host.vars.notification.mail.groups

  assign where host.vars.notification.mail.groups
}

if you have the following in the host:

object Host "my-host" {
  ...

  vars.notification.mail = {
    groups = [ "support" ]
    users = [ "my-boss" ]
  }
}

Regards,
Tobias

On 2015-03-23 13:33, Henti Smith wrote:
Good day all.

 I'm struggling to get my notification working as expected and getting
a strange behaviour where notification mail is sent using the wrong
user.

 The check in question (http) is from a windows client discovered from
the master.
 The check is Unknown in the web interface.

 First off the relevant configs.

 users.conf has two users support and infra each in a group with the
same name.

 apply Notification "mail-support" to Host { import
"support-host-notification" import "custom-host-notification"
user_groups = host.vars.notification.mail.groups assign where
host.vars.notification.mail}
 apply Notification "mail-support" to Service { import
"support-service-notification" import "custom-service-notification"
user_groups = host.vars.notification.mail.groups assign where
host.vars.notification.mail }
 apply Notification "mail-infra" to Host { import
"infra-host-notification" user_groups =
host.vars.notification.mail.groups assign where
host.vars.notification.mail }
 apply Notification "mail-infra" to Service { import
"infra-service-notification" user_groups =
host.vars.notification.mail.groups assign where
host.vars.notification.mail }

 The behaviour I'm seeing is the support user never gets a mail, but
the infra user does and in the debug log I see :

 information/Notification: Sending notification
'hostname!http!mail-support' for user 'infra'

 At first I thought it's a last match scenario so I swapped the
notifications around. This had no affect. The only other thought I had
is that Notification cannot support multiple imports.

 I'm pretty sure I'm getting the logic of using apply wrong here.

 What I’m trying to achieve is as follows: 

Two users called support and infra. 

mail support when services and hosts states = [ Warning, Critical ]
and types = [ Problem, Custom ]
mail infra when services and hosts states = [ Warning, Critical,
Unknown ] and types = [ Custom ]

Am I missing something ? 

H

--

-- [1]


Links:
------
[1] X-Clacks-Overhead:GNUTerryPratchett

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to