Ad Widget

Collapse

Trigger values in actions

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

    #1

    Trigger values in actions

    I have one action defined to notify when a warning condition is detected on any trigger on any host.

    How can I include the value of the item in the action email.

    I specifically don't want to have to define an action per trigger, as I have many triggers.

    Is this possible?
  • cstackpole
    Senior Member
    Zabbix Certified Specialist
    • Oct 2006
    • 225

    #2
    If I understand you right, in your email you want to know what trigger got enabled and a few details about it.

    I tend to use:
    {TRIGGER.NAME}: {STATUS}
    {TRIGGER.COMMENT} <- This, of course, depends on if you have made a comment for that trigger


    I may add a few others depending on the host, but I think that answers your question. If not, have you seen the list of MACROS that can be used? In release 008 of the Zabbix 1.4 PDF Manual the list of macros is on pg 74 under the section 5.3.3 Macros for messages and remote commands. There are a few missing Macros that are mentioned in the forums as well.

    Hopefully this helps you out.
    cstackpole

    Comment

    • cpicton
      Member
      • Nov 2006
      • 35

      #3
      I am trying to get the current value of the item which triggered the trigger as well.

      I have tried adding a macro into the Trigger comment to expand to the item value in the final action, but my resultant email only displays *UNKNOWN*

      Comment

      • dsipe
        Senior Member
        • Oct 2006
        • 184

        #4
        tell us what you exactly put in your email please

        Comment

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

          #5
          Originally posted by cpicton
          How can I include the value of the item in the action email.
          Sure! Use the following macro(s):

          Last value is: {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
          Max value within 10 minutes was: {{HOSTNAME}:{TRIGGER.KEY}.max(600)}

          I think you got the idea...

          ZABBIX 1.4.3 will feature new macro, {ITEM.LASTVALUE} which is actually an alias to {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • ghislain
            Senior Member
            • Jun 2005
            • 160

            #6
            too bad that this does not work on the trigger list:

            {{HOSTNAME}:{TRIGGER.KEY}.last(0)}

            i foudn that the $1 $2 etc.....
            are not interpreted in the trigger listing also(but {HOSTNAME} is).


            so in configuration mode you ahev

            Errors on eth0 (items.php)
            but on the monitoring one you have
            Errors on $1 (tr_status.php)

            It would be great to have it on the screen in the same way as in the items configuration.

            I also think that we lack a link to the trigger.key in the tr_status.php page. It would be great to have a link to:

            simple graph of the trigger.key
            latest data from the host


            either would make the monitoring reaction more efficient.
            Regards,
            Ghislain.

            Comment

            • cpicton
              Member
              • Nov 2006
              • 35

              #7
              Originally posted by Alexei
              Sure! Use the following macro(s):
              Last value is: {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
              Max value within 10 minutes was: {{HOSTNAME}:{TRIGGER.KEY}.max(600)}

              I think you got the idea...
              In order for this to work, I will have to have an action defined for each trigger I have. I would like to use trigger comments to be able to expand macros as above.


              Originally posted by Alexei
              ZABBIX 1.4.3 will feature new macro, {ITEM.LASTVALUE} which is actually an alias to {{HOSTNAME}:{TRIGGER.KEY}.last(0)}
              Will this will help the above problem, where I will be able to have a single notification action defined for all my triggers?

              Comment

              • cpicton
                Member
                • Nov 2006
                • 35

                #8
                Sorry - I reread your above comment, and your suggestion will work for me.

                I would prefer the flexibility of defining the bulk of the action data in the trigger comments, but macros inside trigger comments are not expanded.

                You solution does give me the data I need, though.

                Thanks

                Chris

                Comment

                Working...