Ad Widget

Collapse

Problem with trigger that check signal level for 10 minutes!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris121997
    Junior Member
    • Sep 2024
    • 3

    #1

    Problem with trigger that check signal level for 10 minutes!

    Hi all,
    i wrote a trigger for a personal template that alert me when a signal goes down the last hour average plus a static threshold:

    Code:
    triggers:
    - uuid: ef68948773724d1182b027ff2a2cb020
    expression: 'last(/Mikrotik_RB912_AP/Mikrotik_Signal) < (avg(/Mikrotik_RB912_AP/Mikrotik_Signal,1h) + {$SIGNAL_LEVEL_THRESHOLD})'
    name: 'Mikrotik: Signal level decreased'
    event_name: '{HOST.NAME}: Signal Level decreased (actual level: {ITEM.VALUE})'
    priority: WARNING
    description: 'Signal Level decreased'
    manual_close: 'YES'
    tags:
    - tag: scope
    value: warning
    Now, i want to improve it and i would like to write a trigger that alert me when the signal level goes down the last hour average (plus the static threshold) for 10 minutes.
    That means that if the signal goes down for only 2 or 3 or 4 minutes the triggere won't be start; instead if the signal goes down for 11 minutes it has to start and send the alert.
    How can i modify it to do this?
    Thanks a lot
    Christian
  • kamil1
    Member
    • Aug 2024
    • 40

    #2
    Hi,
    Try to use something like that:
    expression: 'min(10m, /Mikrotik_RB912_AP/Mikrotik_Signal) < (avg(/Mikrotik_RB912_AP/Mikrotik_Signal,1h) + {$SIGNAL_LEVEL_THRESHOLD})'

    Or see the trend functions here:


    Specifically, take a look at trendavg() and trendmin()

    Comment

    • Chris121997
      Junior Member
      • Sep 2024
      • 3

      #3
      Hi, thank you so much, but unfortunalty i think this is not the solution in my case.
      Maybe i can try this expression:

      Code:
      max(10m,/Mikrotik_RB912_AP/Mikrotik_Signal) < (avg(/Mikrotik_RB912_AP/Mikrotik_Signal,1h) + {$SIGNAL_LEVEL_THRESHOLD})
      In this case, the trigger will activate if the maximum value of the signal in the last 10 minutes is lower than the average signal + thresholdm. This means that all signal values in the last 10 minutes must be lower than the threshold for the trigger to fire.
      Maybe, i HOPE!

      Comment

      Working...