in reply to snmpwalk using net::snmp

You can think about snmp as a tree.
snmpwalk displays recursivly all the OIDS beneath a given node.
OIDS are structured similiar to IP-numbers (which can be also represented by a tree) by a string consisting of dots and numbers.
There are informations in this tree which are in common on many different devices (such as printer, router, switches, hosts, raid-arrays or uninteruptible power supplies). They are stored in a standard subtree. An example for this is the system subtree which contains information about sys-location or sys-contact.
Other information is more vendor specific. It is stored in the enterprise subtree and enterprises may reserve there an numeric value for their own vendor-specific information.
The clue point in using snmp is to find out which OIDS you want. Therefore you could use snmpwalk and try to guess the meaning of specific OIDS. This is easy if you want to retrieve the information which is displayed on the LCD of your networked printer but very difficult if you want inoctets of some network device on a switch. Therefore you might need a MIB (Message Information Base) which is a file containing alphanumerical translations of the numerical OIDS (like DNS does for IP-Numbers). In addition a MIB-file contains also explanations on OIDS. Those MIB-Files are usually provided by the manufacturer of your device or (concerning the standard tree) by the vendor of your snmp software (By vendor I mean the Open Source community, do not use buggy and expensive software here)
Using snmpwalk to retrieve information isn't a good idea. You get lots of bullshit you do not want because the SNMP tree is a very large thing (you will also produce a lot of network traffic).
Usually you want to get specific information on each interface of your cisco Therefore you might want to get system.iftable with snmptable (I am sorry, I am at home without access to our high security network to make sure I am giving you the correct OID)
If you explain the complete problem I could probably give you some more assistance.

Regards...

Replies are listed 'Best First'.
Re: Re: snmpwalk using net::snmp
by c (Hermit) on Feb 07, 2002 at 15:42 UTC
    I would have thought that, given a specific OID, an snmpget or snmpset would suffice. However given a specified example from Cisco, it seems that snmpwalk is required. Check out this CCO url and look near the mid to bottom of the page, specifically at steps #3 and #4. i've gone through this procedure, and it seems as though the router won't respond to a snmpget using the show OID. rather, it only responds to a walk.

    thanks! -c

      Yes you are right!
      In this example you really need snmpwalk bacause a whole tree should be copied. snmpget will not work because you will have lots of timeouts on all nodes which are not intended to have a value and on all nodes which do not exist. Setting a small timeout value might cause loosing values.

      Nevertheless a snmpwalk is -- as you said -- nothing else than a recursive get. Performing a bulkget seems also not possible, bacause the Cisco seems to use snmp version 1 only where bulkrequests are (I am not sure but I think so) not implemented.
      Therefore you should use the get_next_request() in a loop which takes the key of the returned hash as an argument for the next request and puts all OIDS and values in one hash. You might want to define a start-OID because usually not all values in the tree are R/W.
      Afterwards you set your configuration-values on the other router using set_request() for each key and voila the configuration is copied.

      Regards....