Ad Widget

Collapse

Zabbix Tag Value in Trigger Action Messages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jameset
    Junior Member
    • Aug 2020
    • 3

    #1

    Zabbix Tag Value in Trigger Action Messages

    Hi

    Could you confirm if you can use trigger tag values in Trigger Action messages?

    For example if I had a tag named TEST with a value of NEW in the message below

    Problem started at {EVENT.TIME} on {EVENT.DATE}
    Problem name: {TRIGGER.NAME}
    Host: {HOST.NAME}
    Severity: {TRIGGER.SEVERITY}
    Tag Value: {EVENT.TAG.TEST}
    Original problem ID: {EVENT.ID}
    {TRIGGER.URL}

    That would give me a line that said
    ...
    Tag Value: NEW
    ...

    This isn't supported in the version of Zabbix we currently have (3.4) but I was hoping looking at the documentation that it was supported in V5.

    Thanks in advance

    James
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Yes you can.
    {EVENT.TAGS.<tag name>} → Trigger-based notifications and commands
    → Problem update notifications and commands
    → Problem and event URLs
    Event tag value referenced by the tag name.
    A tag name containing non-alphanumeric characters (including non-English multibyte-UTF characters) should be double quoted. Quotes and backslashes inside a quoted tag name must be escaped with a backslash.
    Supported since 4.4.2.

    Comment

    • bcarvalho
      Junior Member
      • Feb 2021
      • 3

      #3
      Thank you! that is somenthing I was looking for a couple of days..

      Comment

      • muelli
        Member
        • Jun 2021
        • 68

        #4
        I am trying to do exactly the same as the OP.
        I have a tag assigned to a trigger action like this:

        tag name: TAG_TEST
        value: 12345

        In the alert message template I have this:

        Problem started at {EVENT.TIME} on {EVENT.DATE}
        Problem name: {EVENT.NAME}
        ITSI: {EVENT.TAGS.TAG_TEST}
        Host: {HOST.NAME}
        ....

        However the {EVENT.TAGS.TAG_TEST} is literally printed in the alert message and is not expanded/replaced with 12345.

        If I change the message template to

        Problem started at {EVENT.TIME} on {EVENT.DATE}
        Problem name: {EVENT.NAME}
        ITSI: {EVENT.TAGS}
        Host: {HOST.NAME}
        ....

        It prints the "other" event tags, for example if I write the root fs / full, it expands it to "Application:Filesystem /".
        It seems the TAG_TEST is not being used?
        Last edited by muelli; 08-07-2022, 08:23.

        Comment

        • muelli
          Member
          • Jun 2021
          • 68

          #5
          Ah I think I found the problem. I added the tag to a template that used discovery rules and simply adding the tag to an already discovered item/trigger does not update the _actual_ trigger with the tag.
          I did a re-discovery and it should work now.

          Comment

          Working...