notification variables

Please read about the latest changes and upgrade.
Please note that your newly registered account needs to be manually activated by an admin. Just be patient, you cannot post to any forum before this happens. This is thanks to the unfortunate event of spammers recently. More details here.
  • 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