Junos OS

 View Only
last person joined: yesterday 

Ask questions and share experiences about Junos OS.
  • 1.  MX - SNMP filter-interfaces

    Posted 01-15-2020 11:40

    Hello,

     

    I've got a very specific question, or better, a request about filtering two specific logical interfaces.

    I'm already filtering like this:

     

    beeelze@ams-nik-er2# show snmp

    filter-interfaces {

        interfaces {

            pp0;

            demux0;

            ".\.[0-50000]";

        }

        all-internal-interfaces;

    }

    filter-duplicates;

     

    Now, I want to monitor two specific logical interfaces: ge-1/0/6.287 and ge-1/0/6.288

    At the same time, all other logical interface units may NOT be monitored, for the sake of the MX5's CPU.

    I've tried a lot, but am unable to come up with a solution.

     

    Beelze



  • 2.  RE: MX - SNMP filter-interfaces

     
    Posted 01-15-2020 13:06

    Hello Beeelzebub,

    I think you can use the except (!) function

     

    Starting with Release 12.1, Junos OS provides an except option (! operator) that enables you to filter out all interfaces except those interfaces that match all the regular expressions prefixed with the ! mark.

     

    Refer: https://www.juniper.net/documentation/en_US/junos/topics/task/configuration/snmp-filter-interfaces-configuring-junos-nm.html

     

    For example, to filter out all interfaces except the ge interfaces from the SNMP get and get-next results, enter the following command:

     

    [edit snmp]
    user@host# set filter-interfaces interfaces “!^ge-.*”
    user@host# commit   
     
     
    PS: Please mark my response as solution if it ansers your query. Kunods are appreciated too!

    Thanks
    Vishal


  • 3.  RE: MX - SNMP filter-interfaces

    Posted 01-16-2020 00:08

    Hello,

     

    Yes, that's great!

    I tried adding those 2 interfaces to the snmp filter-interfaces hierarchy:

     

    beelze@ams-nik-er2# top show | compare

    [edit snmp filter-interfaces interfaces]

         ".\.[0-50000]" { ... }

    +    "!^ge-1/0/6.287";

    +    "!^ge-1/0/6.288";

     

    Guess I'm not that good at regular expressions.

    The requirements are:

    - monitor only physical interfaces (leave out the logical units)

    - monitor two logical units from a specific interface

     

    These two interfaces need some extra monitoring on their traffic while still monitoring only the physical interfaces.

     

    Beelze

     

    Beeelze



  • 4.  RE: MX - SNMP filter-interfaces

     
    Posted 01-16-2020 06:28
    Hi Beeelze,

    Can you please remove all other terms and use just following term and verify if it working

    "!^ge-1/0/6.287";
    "!^ge-1/0/6.288";


    Thanks
    Vishal


  • 5.  RE: MX - SNMP filter-interfaces

    Posted 01-17-2020 01:24

    Hello,

     

    If I do that, then nothing is monitored anymore 😞

     

    Marijn



  • 6.  RE: MX - SNMP filter-interfaces
    Best Answer

     
    Posted 01-18-2020 21:53

    HI Beeelzebub,

     

    I have done some testing and following configuration is working perfectly for me. I think it should help you too

     

    vlsingh@vlsingh-T470:~$ snmpwalk -c public -v 2c 10.85.156.55 1.3.6.1.2.1.2.2.1.10
    iso.3.6.1.2.1.2.2.1.10.1 = Counter32: 15509891
    iso.3.6.1.2.1.2.2.1.10.4 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.10.5 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.10.6 = Counter32: 5964762
    iso.3.6.1.2.1.2.2.1.10.7 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.10.8 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.10.9 = Counter32: 0
    iso.3.6.1.2.1.2.2.1.10.10 = Counter32: 0
    <SNIP>

     

    set snmp filter-interfaces interfaces "!(^ge-1/0/0.0|^xe-2/0/0.8)"

     

     

    snmpwalk -c public -v 2c 10.85.156.55 1.3.6.1.2.1.2.2.1.10  <<<<<<<<<<<< now only this counter is showing up
    iso.3.6.1.2.1.2.2.1.10.720 = Counter32: 2590334
    iso.3.6.1.2.1.2.2.1.10.743 = Counter32: 2867704


    PS: Please accpet my response as solution if it asnwers your query, kudos are appreciated too!


    Thanks

    Vishal



  • 7.  RE: MX - SNMP filter-interfaces

    Posted 01-20-2020 05:55

    Hi vlsingh,

     

    Great, that did the job!

    I had to redo an snmp walk in my NMS and it only showed the two interfaces in this example.

    So perhaps the previous post did come up with a solution, but this is a cleaner one.

     

    Thank you very much!

     

    Beelze