Ad Widget

Collapse

Discovery Trigger - find() with multiple values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Epires
    Junior Member
    • Oct 2022
    • 1

    #1

    Discovery Trigger - find() with multiple values

    Good afternoon,



    We`ve been trying to create a trigger for a discovery item that checks its value is equal to a macro. And it worked fine with a “<>” comparison.

    However, we have a new value to be checked, and would like to add it to the same macro, in a way that it would not matter if it is one, two or three values to be compared. It would like as a regex comparison.



    Ex.:

    Macro = (abc|cdb)

    Item value = abc

    Trigger = itemValue = macro [true]

    Ex.2:

    Macro = (abc|cdb)

    Item value = jkl

    Trigger = itemValue = macro [false]

    Ex.3:

    Macro = (abc|cdb)

    Item value = cdb

    Trigger = itemValue = macro [true]



    Is it possible, or is there a better solution for this?​
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    #2
    Sounds like you need the find() function using regexp operator: https://www.zabbix.com/documentation...ctions/history

    find(/myhost/mykey,,regexp,{$MY_MACRO}) = 1

    or something like that. Just make sure your macro value is set to the correct regex, for example ^(abc|cdb)$

    Markku

    Comment

    Working...