Ad Widget

Collapse

Filter for interfaces discovery

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • osmoonlight
    Junior Member
    • Jul 2022
    • 9

    #1

    Filter for interfaces discovery

    I have found a few posts regarding this issue, but nothing has let me so far anywhere. I am trying to exclude unused (disconnected) network interfaces from the reported data by using a filter and not manually disable them in the result for the device, etc. Details are:

    Zabbix 6, Template is a slightly changed (for OIDs mostly) copy of Cisco Catalyst 3750V2 SNMP

    Example data to be filtered: Interface te1/0/14(), where te1/0/14 is {#IFNAME} and () is {#IFALIAS} (from the template)

    Macro in the template is {$NET.IF.IFALIAS.EMPTY}, Value: "Null"

    I added one more Filter to the standard ones from the template: {#IFALIAS} does not match {$NET.IF.IFALIAS.EMPTY}

    Latest data shows all network ports, connected or not.

    Any suggestions on how to go about this? Any changes for the macro other than keeping it null?

    Thanks.
  • Answer selected by osmoonlight at 05-07-2022, 09:40.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    In this context the regular expression for an empty string is ^$

    ("{#IFALIAS} does not match ^$", if you are trying to exclude all interfaces with empty alias)

    But if you really want to exclude interfaces that are operationally down, you need to add ifOperStatus in your interface discovery and then you can use those values to filter the interfaces. See for example the template in https://git.zabbix.com/projects/ZBX/...3750_24fs_snmp. The possible numeric values for ifOperStatus are:

    up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), lowerLayerDown(7)

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      In this context the regular expression for an empty string is ^$

      ("{#IFALIAS} does not match ^$", if you are trying to exclude all interfaces with empty alias)

      But if you really want to exclude interfaces that are operationally down, you need to add ifOperStatus in your interface discovery and then you can use those values to filter the interfaces. See for example the template in https://git.zabbix.com/projects/ZBX/...3750_24fs_snmp. The possible numeric values for ifOperStatus are:

      up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), lowerLayerDown(7)

      Markku

      Comment

      • osmoonlight
        Junior Member
        • Jul 2022
        • 9

        #3
        Thanks, Markku, after changing the macro to the correct one, it now works as intended.

        Helps to speak the right language...

        Comment

        • RaulChiarella
          Member
          • Apr 2021
          • 59

          #4
          Sorry for bringing this back but for the weirdest reason ever, when using this on a MACRO, it does not work.
          {$IFALIAS.EMPTY} VALUE: ^$

          MACRO FILTER: {#IFALIAS} DOES NOT MATCH {$IFALIAS.EMPTY}
          This is so WEIRD AND IT ITS getting on my nerves. It does not work.

          But: {#IFALIAS} DOES NOT MATCH ^$ WORKS

          Comment

          Working...