Ad Widget

Collapse

macros inside trigger comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cpicton
    Member
    • Nov 2006
    • 35

    #1

    macros inside trigger comments

    Hi

    Some of my triggers have different comments, and I would like to use macros inside those comments, so they can be expanded when sending emails/sms

    Specifically, I would like to see current values of items in the comments of the trigger.

    However, my triggers are defined on templates, and if I use something like

    Code:
    Current value on {HOSTNAME} is {Template_Linux:custom[POSTFIX,QUEUE,active].last(0)}
    in the comment field of the trigger, and my action has {TRIGGER.COMMENT} in the body, the resultant email has

    Code:
    Current value on {HOSTNAME} is *UNKNOWN*
    Am I doing something wrong?
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    I'm pretty sure the Template_linux does not collect any data, that's why ZABBIX cannot expand the macro to a real value.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • cpicton
      Member
      • Nov 2006
      • 35

      #3
      It does not collect any data, the the trigger is defined for the template, which is then automatically copied to all the associated hosts.

      I have tried

      Current value is {{HOSTNAME}:custom[POSTFIX,QUEUE,active].last(0)}

      and

      Current value is {Template_Linux:custom[POSTFIX,QUEUE,active].last(0)}

      But in both cases, the macro inside the trigger comment is not expanded in the final email.

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        The first macro should work. I'm going to retest it.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          I just realized that you are talking about trigger comments, not notification messages. This is not supposed to work.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • cpicton
            Member
            • Nov 2006
            • 35

            #6
            Is this on your todo list to be fixed

            It is needed in some situations for me, as it allows the details in the comment of the trigger to be much more detailed and specific to the problem at hand.

            Comment

            Working...