Ad Widget

Collapse

Problem with triggers, last 2 values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vovam
    Junior Member
    • Nov 2020
    • 2

    #1

    Problem with triggers, last 2 values

    Hello all,

    I am trying to create trigger that will trig a PROBLEM only if 2 last values equals to 0 or None

    tried to do this:
    {Vision-Master:netflow_check.sh["{HOST.CONN}"].str(None,#2)}=1 or {Vision-Master:netflow_check.sh["{HOST.CONN}"].regexp(^0$,#2)}=1

    but it went to PROBLEM state after one None or 0

    Zabbix version : 4.4

    Thanks,
    Vova.
    Last edited by vovam; 24-11-2020, 10:56.
  • NilsA
    Senior Member
    • Sep 2020
    • 102

    #2
    The way your expression is set up now means:
    ((last 2 values are none = true) or (last 2 values are 0 = true)) = true
    If you want to have "None" and "0" interchangably, I don't think you can logically connect them into one expression in this case, since you are using .str and .regexp here.
    If you don't find any better way, you can cover all 4 patterns with an expression like this:

    ((last 2 = 0) or (last 2 = None) or (previous #1 = 0 and previous #2 = None) or (previous #1 = None and previous #2 = 0))= true

    Comment

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

      #3
      Originally posted by NilsA
      The way your expression is set up now means:
      ((last 2 values are none = true) or (last 2 values are 0 = true)) = true
      nope... str(None,#2)}=1 is true even if only one of the values is "None". Same with regexp(), its enough to have only one "0" value and whole expression is true. Both of these functions look into the given data, may be more than one value, if at least one match found, returns true.
      https://www.zabbix.com/documentation...gers/functions
      "If more than one value is processed, '1' is returned if there is at least one matching value."

      Comment

      Working...