Ad Widget

Collapse

How to configure multiple trigger activations from the same SNMP traps fallback item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dade
    Member
    • Jan 2021
    • 34

    #1

    How to configure multiple trigger activations from the same SNMP traps fallback item

    Hello, folks!

    I am trying to configure multiple trigger activations from the same SNMP traps fallback item.

    Currently, my item returns 2 different last values (traps), lets call them 'trap 1' and 'trap 2', each containing a string describing a problem. Every 2 minutes, the item returns two last values, separated by a few seconds.

    Additionally, if any of these problems is resolved or a new one occurs, there wont be 2 different traps anymore, so I can't rely on something like {ITEM.LASTVALUE(#)} to check back a specific amount of returned values.

    My goal is to have a trigger (or many, if necessary) to get the "String: problem X ' part of the fallback trap message, set it as trigger name and show me multiple instances of the same trigger, one for each of the problems.

    So, let's say my trigger works like this:
    1 - finds 'String: problem 1 ' in the fallback item
    2 - activates a trigger with the name 'problem 1'
    3 - finds 'String: problem 2 ' of the next returned value of the fallback item
    4 - activates a new instance of the trigger with the name 'problem 2'
    5 - it keeps both triggers active, even as the last value changes from problem 1 to problem 2, back to problem 1, then 2, etc...
    6 - if another problem occurs, it checks that there is now problem 1, 2 and 3, and a new instance of the trigger should be activated, with the name 'problem 3', while keeping the other two active
    7 - if problem 2 dissappears, it checks that the latest iterations of last values do not contain problem 2, only problem 1 and 3, and clears the trigger instance for problem 2
    8 - if no problems show up, and fallback item is empty, no trigger instances are activated


    The only guarantee I have is that, even though the number of problems can change, they will all show up in each check, but possibly not in the same order.
    So it will be something like this:
    10:00:01 problem 1
    10:00:03 problem 2

    10:02:01 problem 1
    10:02:03 problem 2

    10:04:01 problem 1
    10:04:03 problem 2
    10:04:05 problem 3

    10:06:01 problem 1
    10:06:03 problem 3

    and not:
    10:00:01 problem 1
    10:00:03 problem 1

    10:02:01 problem 2
    10:02:03 problem 2

    10:04:01 problem 1
    10:04:03 problem 2
    10:04:05 problem 1

    10:06:01 problem 3
    10:06:03 problem 3

    What I want to make clear is that I CAN use a time interval over 2mins as a way to check any changes, but not the number of returned last values.

    Is this possible with only one trigger?
    If not, what can I do if I do not know exactly what the 'String: problem X' is, meaning, I don't know what to compare it to.

    Thanks in advance
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    If the content and format are known in advance for these two traps, then why use "fallback"?
    Create two items that receive only the desired values, and process their combination in the trigger.
    Or create dependent items from "fallback" ....

    Comment

    • dade
      Member
      • Jan 2021
      • 34

      #3
      Actually i dont know the contents or formats for these traps and there are several types of traps.

      Comment

      • astro_Avery
        Junior Member
        • May 2021
        • 5

        #4
        You just have to make an item that uses regex to receive only the "problem started" trap and the "problem ended" trap from that specific problem. If you have a lot of different problems then it's going to be a lot of work of course but it's the only way. If you don't know what the traps will look like then try to find a .mib file for your device or just try to learn from the traps you have received.

        This website really helped me with regex when I was in the position you were in:
        Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.

        Comment

        Working...