MIBs on a router

Answered Question
Sep 10th, 2009
User Badges:
  • Purple, 4500 points or more

Is there a way to pull the mib db from the router locally with show commands, or do I have to use snmpwalk?

Correct Answer by Joe Clarke about 7 years 6 months ago

None, unfortunately. You can't use these commands to build a proper SNMP Walk since some of the OIDs come back partially translated. However, if you want to see all of the OIDs supported by a given device, use the command:


show snmp mib


You can then plug those OIDs into the "snmp get" command to get their values.

Correct Answer by Joe Clarke about 7 years 6 months ago

You have to use an SNMP operation. IOS has a built-in SNMP manager which can be enabled with the command:


snmp-server manager


Then, you can use snmp get and get-next directly from the device:


snmp get IPADDRESS COMMUNITY [retry X] [timeout X] oid OID


snmp get-next IPADDRESS COMMUNITY [retry X] [timeout X] oid OID


snmp get-bulk v2c IPADDRESS COMMUNITY [retry X] [timeout X] non-repeaters X max-repititions X OID OID


snmp set IPADDRESS COMMUNITY [retry X] [timeout X] oid VARBIND {integer | string | ip-address | counter | gauge | timeticks} VALUE ...

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Joe Clarke Thu, 09/10/2009 - 08:07
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

You have to use an SNMP operation. IOS has a built-in SNMP manager which can be enabled with the command:


snmp-server manager


Then, you can use snmp get and get-next directly from the device:


snmp get IPADDRESS COMMUNITY [retry X] [timeout X] oid OID


snmp get-next IPADDRESS COMMUNITY [retry X] [timeout X] oid OID


snmp get-bulk v2c IPADDRESS COMMUNITY [retry X] [timeout X] non-repeaters X max-repititions X OID OID


snmp set IPADDRESS COMMUNITY [retry X] [timeout X] oid VARBIND {integer | string | ip-address | counter | gauge | timeticks} VALUE ...

John Blakley Thu, 09/10/2009 - 08:57
User Badges:
  • Purple, 4500 points or more

You have NO idea how much trouble you've saved me :)


Thanks Joe!


John

John Blakley Thu, 09/10/2009 - 09:21
User Badges:
  • Purple, 4500 points or more

Joe,


I'm not great with snmp, but this isn't working. I can enable snmp-server manager, but when I try to do the above commands, it doesn't work. It says that it's invalid. What version IOS do I need for this to be able to work? I'm trying to get the oid for the interface that I need to monitor in the other thread that we were discussing. The problem is that I'm running this in gns (same IOS I'm running on my real routers), and I don't have any other way to be able to pull the mibs.


Thanks,

John

Joe Clarke Thu, 09/10/2009 - 08:37
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

The SNMP commands are hidden. You won't be able to use '?' to get help from the parser. Just type blindly following me examples. If you provide me the full inputs to the command, I can give you the exact command to type.

John Blakley Thu, 09/10/2009 - 09:25
User Badges:
  • Purple, 4500 points or more

Which command above will allow me to get all of the oids like snmpwalk?

Correct Answer
Joe Clarke Thu, 09/10/2009 - 08:56
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

None, unfortunately. You can't use these commands to build a proper SNMP Walk since some of the OIDs come back partially translated. However, if you want to see all of the OIDs supported by a given device, use the command:


show snmp mib


You can then plug those OIDs into the "snmp get" command to get their values.

John Blakley Thu, 09/10/2009 - 12:03
User Badges:
  • Purple, 4500 points or more

Joe,


I've got two routers, back to back, in gns. I configured snmp on one router, and then I enabled snmp-server manager on the other. I can't get anything from one router to the other. I'm assuming this could be a problem with gns, or is this an issue with using the get statement on the router?


I also tried forwarding udp using a helper statement thinking that was doing something, but it still times out.


Thanks,

John

Joe Clarke Thu, 09/10/2009 - 13:16
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

I would need to see the config from the target router, and the command you're running on the source router.

Actions

This Discussion