This KB explains the SNMP MIB OID used to retrieve the number of routes for each VRF instance.
As a general rule, you should use the SNMP MIB Explorer to search for the appropriate SNMP MIB OID that provides the information you want to retrieve.
However, it is not always obvious which specific information shown in a show command corresponds to a particular SNMP MIB OID. Therefore, actual verification is required. An example is provided below for reference.
For retrieving the number of routes per VRF instance the following OID is useful.
mplsL3VpnVrfPerfCurrNumRoutes1.3.6.1.2.1.10.166.11.1.3.1.1.3
Example;
user@mx240> show snmp mib walk mplsL3VpnVrfPerfCurrNumRoutesmplsL3VpnVrfPerfCurrNumRoutes.3.48.48.50 = 17mplsL3VpnVrfPerfCurrNumRoutes.3.48.48.51 = 11mplsL3VpnVrfPerfCurrNumRoutes.3.48.48.52 = 11--- snip ---
user@mx240> show snmp mib walk 1.3.6.1.2.1.10.166.11.1.3.1.1.3mplsL3VpnVrfPerfCurrNumRoutes.3.48.48.50 = 17mplsL3VpnVrfPerfCurrNumRoutes.3.48.48.51 = 11mplsL3VpnVrfPerfCurrNumRoutes.3.48.48.52 = 11--- snip ---
user@mx240> show snmp mib walk mplsL3VpnVrfDescriptionmplsL3VpnVrfDescription.3.48.48.50 = 001mplsL3VpnVrfDescription.3.48.48.51 = 002mplsL3VpnVrfDescription.3.48.48.52 = 003--- snip ---
user@mx240> show configuration | display set | match instance | match descriptionset routing-instances 001 description 001set routing-instances 002 description 002set routing-instances 003 description 003--- snip ---
user@mx240> show route summary--- snip ---001.inet.0: 12 destinations, 17 routes (10 active, 0 holddown, 4 hidden) Direct: 2 routes, 2 active Local: 3 routes, 3 active BGP: 11 routes, 4 active Static: 1 routes, 1 active
002.inet.0: 8 destinations, 11 routes (8 active, 0 holddown, 2 hidden) Direct: 2 routes, 2 active Local: 3 routes, 3 active BGP: 6 routes, 3 active
003.inet.0: 8 destinations, 11 routes (8 active, 0 holddown, 2 hidden) Direct: 2 routes, 2 active Local: 3 routes, 3 active BGP: 6 routes, 3 active