Ad Widget

Collapse

check if a value is between 2 values

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wjterveld
    Junior Member
    • Oct 2019
    • 20

    #1

    check if a value is between 2 values

    Hi,

    I use an SSL check to see if the certificate is going to expire in 90 days, this will return an Information "warning". Then I have a SSL check to see if the certificate will expire in 60 day. then 30 and then 15 day. So I have 4 check in total.
    My problem is that the first checks will remain, when a certificate expires in 10 days I have 4 problems instead of just 1.
    I would like the first check to go of between 90 and 60 days, then the second between 60 and 30 days etc etc
    The fist check is:
    ssl_cert_check_expire[{#IPADDR},{#SSLPORT},{#SSLDOMAIN},{#TIMEOUT}].last(#3)}<=90
    Now I can make an "Recovery expression":
    ssl_cert_check_expire[{#IPADDR},{#SSLPORT},{#SSLDOMAIN},{#TIMEOUT}].last(#3)}<=60

    but the problem is the first check will overrule ..

    How can I make it so the first check only checks between 90 and 60 ??
  • Answer selected by wjterveld at 22-12-2022, 10:35.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    You can use trigger dependencies (https://www.zabbix.com/documentation...s/dependencies) to get the later trigger to "mask" the previous trigger(s).

    Or, you can use "and" in your trigger expressions: last() <= 90 and last() > 60

    I don't know why you use #3 in the expression, but anyway.

    Markku

    Comment

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

      #2
      You can use trigger dependencies (https://www.zabbix.com/documentation...s/dependencies) to get the later trigger to "mask" the previous trigger(s).

      Or, you can use "and" in your trigger expressions: last() <= 90 and last() > 60

      I don't know why you use #3 in the expression, but anyway.

      Markku

      Comment

      • wjterveld
        Junior Member
        • Oct 2019
        • 20

        #3
        Thanx I will try this.
        the #3 came from the template. I do not know the meaning at all :-)

        Comment


        • Hamardaban
          Hamardaban commented
          Editing a comment


          last (<sec|#num>,<time_shift>)
          The most recent value. sec (ignored, equals #1) or [HASHTAG="t19"]num[/HASHTAG] (optional) - the Nth most recent value
          time_shift (optional) - evaluation point is moved the number of seconds back in time Supported value types: float, int, str, text, log

          Take note that [HASHTAG="t19"]num[/HASHTAG] works differently here than with many other functions.
          For example:
          last() is always equal to last(#1)
          last(#3) - third most recent value (not three latest values)

          Zabbix does not guarantee exact order of values if more than two values exist within one second in history.
      • wjterveld
        Junior Member
        • Oct 2019
        • 20

        #4
        great!! thanx for the explanation...
        And thanx for the "AND" "OR" my check now runs the way I wanted..

        Comment

        Working...