SNMP Walk

How do I perform an SNMP walk of a specific table?

Date Entered: 11/28/2007    Last Updated: 03/31/2017

An SNMP walk, or "table walk" is just a series of get-next requests. The requests start at the beginning OID for a particular table (i.e., the System table at 1.3.6.1.2.1.1), and continue on until the response from the agent is outside of the table.

The SNMPMgr and SNMPTCPMgr components allow you to easily do an SNMP walk by calling the Walk method and passing the desired tableOid. You can also set the WalkLimit property to a non-zero value if you wish to limit the number of objects the walk will traverse in the table.

C# // Walk the first 5 objects in the System (1.3.6.1.2.1.1) table. mgr.WalkLimit = 5; mgr.Walk("1.3.6.1.2.1.1"); // Print out the names and values of the walked objects. for (int i = 0; i < mgr.Objects.Count; i++) { Console.WriteLine(mgr.Objects[i].Oid + ": " + mgr.Objects[i].Value); }

We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.