Ad Widget

Collapse

Triggers - All last 'n' values different from 'x'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RaulChiarella
    Member
    • Apr 2021
    • 59

    #1

    Triggers - All last 'n' values different from 'x'

    Hello there!

    I am doing a trigger with the expression:

    ...serialCheck.last(#5)}<>2

    What i thought it would happen is: If ALL the last 5 values is not 2 the trigger is true.
    What is happening: If ANY of the last 5 values is not 2 the trigger is true.

    How do i fix this? I tried changing to .sum(#5)<>2 but it didnt work - Instead all of my hosts using this trigger got a Problem.

    If i got the following values, that two of them on the last 5 is 2:
    2 2 2 2 2 1 0 2 1 2 = Trigger will Ignore.

    But if the last 5 is different from 2:
    2 2 2 2 2 0 0 1 0 1 = Trigger is true

    Can someone help me?
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    ...serialCheck.count(#5,2)}= 0

    Comment


    • RaulChiarella
      RaulChiarella commented
      Editing a comment
      I didnt understand what = 0 meant. I have values different than 2: 1, 3, 0, 4, etc...
      If you dont mind could u explain what that expression did please?
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #3
    it means 0 values equal 2 from the last 5 values

    Comment


    • RaulChiarella
      RaulChiarella commented
      Editing a comment
      Thanks, i got it! So if the last 5 values were not 2 the trigger is true. Thanks! I did serialCheck.count(#15,2,ne)}=15 instead.
Working...