notification variables

  • Hello,


    i'm trying to get my notifications as clean as possible and i am facing the following issue.


    I tried to put this in my template :

    Code
    1. template Host "xxxxxxxxx" {
    2. vars.notification["mail"] = { users = vars.notification.mail.users + ["mygroup"] }
    3. }

    but it doesn't work.
    I have to do this :


    Code
    1. template Host "xxxxxxxxxxx" {
    2. #get mails in other template
    3. var mail = vars.notification.mail.users;
    4. vars.notification["mail"] = { users = mail + ["mygroup"] }
    5. }

    Why i have to use 2 variables ?


    Thanks in advance.

  • Hello,


    The goal here is to define notification groups on templates.
    On my hosts,i import differents templates with differents groups, but if i import 2 templates with notification group, it will use only the last one.


    here is what is working :

    Thanks

  • could you not concatenate those lambda funktions something like this:
    vars.notification["mail"] += { users = mail + ["team2"] } or however you want to do this.
    Personally I would make an apply rule for the notifications that filters by certain groups like team1, team2 etc

    Linux is dead, long live Linux