Hi there,
All configs below:
/* users.conf */
object User "infra" {
import "generic-user"
display_name = "Infra"
groups = [ "infra" ]
email= "infra@hostname"
}
object User "support" {
import "generic-user"
display_name = "Support"
groups = [ "support" ]
email = "support@hostnmae"
}
object UserGroup "support" {
display_name = "Support Group"
}
object UserGroup "infra" {
display_name = "Infra Group"
}
/* notifications.conf */
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
}
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
}
/* templates.conf */
template Notification "support-host-notification" {
command = "mail-host-notification"
states = [ Warning, Critical ]
types = [ Problem, Custom ]
period = "24x7"
}
template Notification "custom-host-notification" {
command = "mail-host-notification"
states = [ Warning, Critical, Unknown ]
types = [ Custom ]
period = "24x7"
}
template Notification "support-service-notification" {
command = "mail-service-notification"
states = [ Warning, Critical ]
types = [ Problem, Custom ]
period = "24x7"
}
template Notification "custom-service-notification" {
command = "mail-service-notification"
states = [ Warning, Critical, Unknown ]
types = [ Custom ]
period = "24x7"
}
template Notification "infra-host-notification" {
command = "mail-host-notification"
states = [ Up ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
}
template Notification "infra-service-notification" {
command = "mail-service-notification"
states = [ OK ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
}
On Mon, Mar 23, 2015 at 3:02 PM, Michael Friedrich <
[email protected]> wrote:
> Am 23.03.2015 um 13:33 schrieb Henti Smith:
>
> 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
> }
>
>
> Please paste them line by line, it's pretty much unreadable currently.
>
>
> 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.
>
>
> Your host object definition would be interesting. This is referenced as
> user_groups source in your notification apply rules.
>
>
> 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
>
> --
> --
>
>
> _______________________________________________
> icinga-users mailing
> [email protected]https://lists.icinga.org/mailman/listinfo/icinga-users
>
>
>
> --
> Michael Friedrich, DI (FH)
> Application Developer
>
> NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
> Tel: +49 911 92885-0 | Fax: +49 911 92885-77
> GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
> http://www.netways.de | [email protected]
>
> ** OSDC 2015 - April - osdc.de **
> ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp **
> ** OSBConf 2015 - September - osbconf.org **
>
> _______________________________________________
> icinga-users mailing list
> [email protected]
> https://lists.icinga.org/mailman/listinfo/icinga-users
>
>
--
-- <X-Clacks-Overhead: GNU Terry Pratchett>
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users