Ad Widget

Collapse

Network interface name LLD rule

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbarnett
    Junior Member
    • Jun 2015
    • 3

    #1

    Network interface name LLD rule

    I'm trying to create a network discovery rule, but filter out the interfaces whose names do match the following regex:

    ^(em\d|eth\d)$

    I've created the custom regex and named it for instance "custom regex"

    Then I've created a discovery rule and under the Filter tab I've populated it like so:
    Macro = {#IFNAME}
    Regular Expression = @custom regex

    Then I've populated the following item prototypes:
    net.if.in[{#IFNAME}]
    net.if.out[{#IFNAME}]

    I know for a fact the host I'm testing this on has SEVERAL em[1-4] interfaces, as well as a few others.

    What I'm looking for is a discovery rule that will work in a template and only detect the interface whose names MATCH the regex/filter.

    Nothing seems to be working. Any help would be much appreciated! Thanks
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    Does the LLD rule create respective items when having no regular expression filter set at all?

    Comment

    • jbarnett
      Junior Member
      • Jun 2015
      • 3

      #3
      Originally posted by BDiE8VNy
      Does the LLD rule create respective items when having no regular expression filter set at all?
      Yup, all network interfaces show up with no filter, or even if we filter in reverse via regex of things we DON'T WANT TO SEE by setting the regex result to "result = FALSE".

      However, one of my coworkers just tested the following regex

      ^(eth|em) [Result is TRUE]

      But my regex that included the "\d" designators (for digits) did not. Does zabbix have issues with \d or anything with a slash?

      Comment

      • BDiE8VNy
        Senior Member
        • Apr 2010
        • 680

        #4
        Hmm, maybe a version issue/bug.
        On Zabbix 2.2.9 I can confirm that your expression ^(em\d|eth\d)$ gets correctly evaluated by frontend test.

        Comment

        • jbarnett
          Junior Member
          • Jun 2015
          • 3

          #5
          Originally posted by BDiE8VNy
          Hmm, maybe a version issue/bug.
          On Zabbix 2.2.9 I can confirm that your expression ^(em\d|eth\d)$ gets correctly evaluated by frontend test.
          OK sounds like a bug in my version then. I'm using 2.4.3 and the \d definitely DO NOT work. Can anyone else confirm this on 2.4.3?

          Comment

          Working...