08-20-2010 08:48 AM
Does anyone know if there is a standard or Cisco MIB branch that would give me the size (number of entries) in the current routing table? I need to be able to monitor it via a simple SNMP poll. I know I could do it with a newer embedded events manager and the ability to update the MIB from the output of "show ip route sum" but I'm looking for a simpler solution.
Thanks
Solved! Go to Solution.
08-20-2010 10:46 PM
Actually, you don't need EEM for this. You can use the EXPRESSION-MIB by itself to count the number of routers in the table. See this thread for an example of how to count the number of entries in a table:
https://supportforums.cisco.com/message/3017480
The table in your case is the ipRouteTable. The best object to count in this table is ipRouteDest.
08-20-2010 10:46 PM
Actually, you don't need EEM for this. You can use the EXPRESSION-MIB by itself to count the number of routers in the table. See this thread for an example of how to count the number of entries in a table:
https://supportforums.cisco.com/message/3017480
The table in your case is the ipRouteTable. The best object to count in this table is ipRouteDest.
08-23-2010 11:47 AM
Sorry Joe, but I'm missing a couple things. Here is what I've been using, (actually the system I'm running this from doesn't have the Expression-MIB, so I'm using the numeric OID for everything, but with the Named OIDs I have....
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
Lastly what OID do I query to get the route count? expValueInteger32Val.2.0.0?
08-23-2010 01:02 PM
Never mind. I got it. I finally looked at the first test and realized that my NMS system was putting in 1.3.6.1.2.1.4.21.1.1 for the ipRouteDest, instead of 1.3.6.1.2.1.4.21.1.8. No idea why, but once I fixed that, it worked! In case anyone else wants to try..... These are the numerical OIDs incase you don't have the Expression-MIB compiled into your NMS.
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
snmpset -v 2c -c private
To get the count of the entries in the IP route table, use the following:
snmpget -v 2c -c private
Oh, I also found out that if you don't want to have to set these after every reboot, you need to so a "write mib-data" on the router after you set them, and you might also want to issue the config command "snmp mib persist expression"
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: