Routing

Expand all | Collapse all

SNMP OID for Route Table Size

  • 1.  SNMP OID for Route Table Size

    Posted 08-31-2018 09:19

    Looking for the OID for the route table size.

     

    MX480 on 15.1R6.7

     

    IPv4 Route Tables:
    Index         Routes     Size(b)
    --------  ----------  ----------
    Default       725254    98634540

     

    I want the second number. I can't find it anywhere. Loaded all the MIBs in a browser and searched. Searched through Juniper's MIB explorer. I can get the PFE memory utilization, which is helpful, but I'd like to see the 725254 number as well.

     

    Anybody happen to know the OID or the jnx name for this OID?

     

    Thanks



  • 2.  RE: SNMP OID for Route Table Size

    Posted 09-02-2018 00:50

    Hello,

    JUNOS supports IP-FORWARD standard MIB (RFC 4292) and this MIB has inetCidrRouteNumber OID:

    https://tools.ietf.org/html/rfc4292

       inetCidrRouteNumber OBJECT-TYPE
           SYNTAX     Gauge32
           MAX-ACCESS read-only
           STATUS     current
           DESCRIPTION
                  "The number of current inetCidrRouteTable entries that
                   are not invalid."
       ::= { ipForward 6 }

    In my lab It shows a number close to the one in "show route summary" CLI printout:

     

    VMX-0(R1 vty)# show route summary    
    
    IPv4 Route Tables:
    Index         Routes     Size(b)
    --------  ----------  ----------
    Default           28        3588
    regress@R1> show snmp mib walk ascii inetCidrRouteNumber             
    inetCidrRouteNumber.0 = 23
    
    regress@R1> show route summary 
    Autonomous system number: 65001
    Router ID: 203.0.113.1
    
    inet.0: 19 destinations, 24 routes (19 active, 0 holddown, 0 hidden)

    HTH

    Thx

    Alex



  • 3.  RE: SNMP OID for Route Table Size

     
    Posted 09-03-2018 22:39

    Hi Folks,

    Please find some pointers on Using the Enterprise-Specific Utility MIB to Enhance SNMP Coverage, you can try exploring on that front,

     

    https://www.juniper.net/documentation/en_US/junos/topics/task/operational/snmp-best-practices-utility-mib-using.html


    Event Policy Configuration
    To configure an event policy that runs the show system buffers command every hour and invokes check-mbufs.slax to store the show system buffers data into Utility MIB objects, include the following statements at the [edit] hierarchy level:

    content_copy
    zoom_out_map
    event-options {
    generate-event {
    1-HOUR time-interval 3600;
    }
    policy MBUFS {
    events 1-HOUR;
    then {
    event-script check-mbufs.slax; # script stored at /var/db/scripts/event/
    }
    }
    event-script {
    file check-mbufs.slax;
    }
    }

    check-mbufs.slax Script
    The following example shows the check-mbufs.slax script that is stored under /var/db/scripts/event/:

    content_copy
    zoom_out_map
    ------ script START ------
    version 1.0;

    ns junos = "http://xml.juniper.net/junos/*/junos";
    ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
    ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
    ns ext = "http://xmlsoft.org/XSLT/namespace";

    match / {
    <op-script-results>{
    var $cmd = <command> "show system buffers";
    var $out = jcs:invoke($cmd);

    var $lines = jcs:break_lines($out);
    for-each ($lines) {
    if (contains(., "current/peak/max")) {
    var $pattern = "([0-9]+)/([0-9]+)/([0-9]+) mbufs";
    var $split = jcs:regex($pattern, .);
    var $result = $split[2];

    var $rpc = <request-snmp-utility-mib-set> {
    <object-type> "integer";
    <instance> "current-mbufs";
    <object-value> $result;
    }
    var $res = jcs:invoke($rpc);
    }
    }
    }
    }
    ------ script END ------