Ad Widget

Collapse

Zabbix LLD and regex

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cenzoooo
    Member
    • Jul 2015
    • 37

    #1

    Zabbix LLD and regex

    I use LLD from Robin Roevens, which works perfectly fine, but my problem is with regex in zabbix!

    I want LLD to find all interfaces with OIDs 1.3.6.1.2.1.2.2.1.2(ifDescr) and 1.3.6.1.2.1.31.1.1.1.18(ifAlias) and i want to filter all interfaces which port description(ifAlias) starts for example with A,B,C etc... And this part of regex works very well indeed! The problem is when i try to exclude all interfaces with "TEST" inside of name.

    My regex looks like:
    ^[?=(A|B|C|F|H|G|I|P|U|V|W)](?!.*TEST)

    This regex actually works when i test expression in zabbix! It returns TRUE for example "Axxx,Bxxx,GHxxx" and FALSE for "AxxxTESTxxx,TESTxxx, BTESTxxx" so from this perspective everything should work fine! But when i put that (?!.*TEST) part in regex, my LLD can't find any interface anymore and delete them all. When i return regex back to only ^[?=(A|B|C|F|H|G|I|P|U|V|W)] it works again, but with all "TEST" interfaces also.

    Any ideas?
  • Cenzoooo
    Member
    • Jul 2015
    • 37

    #2
    I have also tried to put 2 separate regex and make 2 filters for each in discovery item with A and B logic, but that did not work either

    Comment

    • Cenzoooo
      Member
      • Jul 2015
      • 37

      #3
      BUMP, still did not solve issue

      Comment

      • ingus.vilnis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2014
        • 908

        #4
        Hi,

        Here is what you can try (as an idea, I did not test it myself. Please correct the statements accordingly).
        Code:
        Administration -> General -> Regular Expressions
        Create a new expression with two actual expressions underneath it:
        Code:
        Expression			Expression type		Case sensitive	 
        ^[(A|B|C|F|H|G|I|P|U|V|W)]$	Result is TRUE		No	Edit   Remove
        ^(.*TEST)$			Result is FALSE		No	Edit   Remove
        Pay close attention to Expression type - Result is TRUE or Result is FALSE.

        Hope this helps!

        Best Regards,
        Ingus

        Comment

        Working...