Hi,

I'm converting an old nagios installation, and I am trying to make
things a bit more meta[1], and I'm a bit stuck...
I have this:

apply Notification "mail-host" to Host {
  import "host-notification"
  command = "mail-host-notification"

  user_groups = host.vars.notification.groups

  assign where host.vars.notification.groups
}

The problem is that not all users have email addresses, for example,
some only have phone numbers to receive texts, some have some other
notification services...
Anyway, with this, it creates notifications for all the users, and I
can't seem to find a way to limit it to "only users with emails".

I tried a few things,but I can't seem to be able to do something like
"ignore where !user.email"...

What I am doing now is in the mail-host-notification script "[ -z
"${USEREMAIL}" ] && exit".  But it feels silly, and I'd rather find some
other way that does not involve creating a notification that will be
dropped.

Any ideas would be welcome :-)


1) I even added a meta host-parent definition to the doc:
  
https://github.com/Icinga/icinga2/commit/8e63643d8bea7ffa25fca8fe4f6a07453f16861f

-- 
Mathieu Arnold


Attachment: signature.asc
Description: OpenPGP digital signature

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

Reply via email to