Ad Widget

Collapse

What is proper way to define trigger expression for two consecutive measurements

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • markosa
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Aug 2022
    • 104

    #1

    What is proper way to define trigger expression for two consecutive measurements

    Hi all,

    I've been trying to define trigger expression which would trigger only when two consecutive (snmp polled)values are below threshold. My current solution is like: last(/device1/item1[{#INDEX},2])<last(/device1/threshold1[{#INDEX}]) and last(/device1/item1[{#INDEX},2],#2)<last(/device1/threshold1[{#INDEX}])
    I've tried min() with time value larger than two polls but its not helping since it just takes lowest value and trigger fires...

    Values are like(most recent first): 10, 15, 20, 10, 15, 18 and so on, threshold is set to (read from device) 15 and if two consecutive values are below threshold, trigger should fire.
    Is my current solution only way solve this?​
  • Answer selected by markosa at 01-12-2022, 07:19.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    max(/host/item,#2) < your_threshold

    will trigger if the last two values are both below the threshold value.

    Markku

    Comment


    • superlava
      superlava commented
      Editing a comment
      Yes, This trigger will fire when last values are less than threshold. You can also use avg here.
  • superlava
    Junior Member
    • Nov 2021
    • 26

    #2
    taking average of 2 values will solve your issue.

    Comment

    • markosa
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Aug 2022
      • 104

      #3
      Yes, avg() is one way but it causes another problem, you need to define window from where to look and in case update interval is changed, trigger needs to be changed...

      Comment

      • superlava
        Junior Member
        • Nov 2021
        • 26

        #4
        How often this item gets updated? Based on that you can set the trigger.

        Further, You can set to check latest last values by appending # to time. Example avg(Key, #10)​. will revert avg of last 10 values.

        Hope this help.
        Last edited by superlava; 30-11-2022, 12:45.

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #5
          max(/host/item,#2) < your_threshold

          will trigger if the last two values are both below the threshold value.

          Markku

          Comment


          • superlava
            superlava commented
            Editing a comment
            Yes, This trigger will fire when last values are less than threshold. You can also use avg here.
        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #6
          Average does not work here:
          when two consecutive (snmp polled)values are below threshold
          Example: threshold is 10, values are 7 and 11. max(#2) is 11 (not triggered, ok), avg(#2) is 9 (triggered, but not correct)

          Markku

          Comment


          • superlava
            superlava commented
            Editing a comment
            Thank You Markku. I was considering binary values only. I forgot about range of a values. markosa Go with max only
        Working...