Ad Widget

Collapse

Show values from items in trigger on calculated item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hakim013
    Junior Member
    • Jun 2016
    • 5

    #1

    Show values from items in trigger on calculated item

    Hi,

    I have 2 ITEMS that receive values. These values are used in a calculated ITEM.
    I have created a trigger based on the calculated ITEM.

    Is it possible to show the 2 ITEM values in the trigger?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2

    {ITEM.LASTVALUE} → Trigger-based notifications and commands
    → Problem update notifications and commands
    → Trigger names, event names, operational data and descriptions
    → Tag names and values
    → Trigger URLs7
    The latest value of the Nth item in the trigger expression that caused a notification.
    It will resolve to *UNKNOWN* in the frontend if the latest history value has been collected more than the Max history display period time ago (set in the Administration->General menu section).
    Note that since 4.0, when used in the problem name, it will not resolve to the latest item value when viewing problem events, instead it will keep the item value from the time of problem happening.
    Supported since 1.4.3. It is alias to {{HOST.HOST}:{ITEM.KEY}.last()}.
    Customizing the macro value is supported for this macro; starting with Zabbix 3.2.0.

    This macro may be used with a numeric index e.g. {ITEM.LASTVALUE<1-9>} to point to the first, second, third, etc. host in a trigger expression. See indexed macros.

    Comment

    • Hakim013
      Junior Member
      • Jun 2016
      • 5

      #3
      @Hamardaban I'm not sure why you would just paste excerpt from Zabbix help. As I already read it.
      Do you understand that I want the values from the items USED in the calculated item.

      So if ITEM1 values = 1 and ITEM2 value = 2
      The calculated ITEM shows value 3

      I want the trigger on the calculated ITEM to show value 1 and 2

      Your solution will only show the value 3

      Comment

      • Hamardaban
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • May 2019
        • 2713

        #4
        I understand your question.Do you understand the documentation?
        In short - there is no possibility.
        Or do you think that the developers have hidden from you this most necessary feature?

        Comment

        • Hakim013
          Junior Member
          • Jun 2016
          • 5

          #5
          My Appologies. I was hoping the community had some kind of workaround.
          Thanks anyway.

          Comment


          • Hamardaban
            Hamardaban commented
            Editing a comment
            Unfortunately, not everything can be done... Do not despair! I am sure that your task can be changed and a solution can be found in a different plane. :-)
        • james.cook000@gmail.com
          Member
          • Apr 2018
          • 49

          #6
          Hi Hakim013,

          The work around that I have always found to work is to use those items in the trigger expression and ensure that they will always evaluate to true for example:

          New Zabbix Trigger Format -

          nodata(/Template XXXX/item_one,1)>=0
          and
          nodata(/Template XXXX/item_two,1)>=0
          and
          ​​​​​​​last(/Template XXXX/calculated_item,#1)>1000

          Old Zabbix Trigger Format -

          {Template XXX:item_one.nodata(1)}>=0
          and
          {Template XXX:item_two.nodata(1)}>=0
          and
          {Template XXX:calculated_item.last(#1)}>1000

          NOTE: nodata() returns a 0 or 1 so if you use >=0 it is always true

          This does have ramifications on the time the triggers are evaluated I believe for example time based triggers are evaluated every 30 seconds where non-time based triggers are evaluated upon item arrival.

          So you want to make the trigger functions as lean as possible and always ensure they are true which is why I use either "nodata(1)>=0" or "count(1)>=0"

          Once you do the above you can do the normal thing in your trigger description i.e. {ITEM.VALUE1}, {ITEM.VALUE2}, {ITEM.VALUE3}.

          What would be nice and probably needs a feature request, is in the trigger description that you would be able to just specify something like:

          last(/Template XXXX/item_one,#1)
          last(/Template XXXX/calculated_item,#1)
          last(/Template XXXX/calculated_item,#1)

          OR

          last(/Host XXXX/item_one,#1)
          last(/Host XXXX/calculated_item,#1)
          last(/Host XXXX/calculated_item,#1)

          Anyway hope this helps...



          Comment

          Working...