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?



  • 2.  RE: SNMP OID for Route Table Size

    Posted 09-02-2018 00:50


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

       inetCidrRouteNumber OBJECT-TYPE
           SYNTAX     Gauge32
           MAX-ACCESS read-only
           STATUS     current
                  "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:
    inet.0: 19 destinations, 24 routes (19 active, 0 holddown, 0 hidden)




  • 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,


    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:

    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/:

    ------ script START ------
    version 1.0;

    ns junos = "*/junos";
    ns xnm = "";
    ns jcs = "";
    ns ext = "";

    match / {
    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 ------