Thanks. - Jerry
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield Sent: Tuesday, November 10, 2009 12:32 AM To: Jerry Huang (jerhuang) Cc: [email protected] Subject: Re: snmpbulkwalk syntax 2009/11/9 Jerry Huang (jerhuang) <[email protected]>: > When I try the following snmpbulkwalk command, I will get "No Such > Instance" message. > > [jerhu...@snmplab-linux2 ~/performance_extra]$ snmpbulkwalk -v2c -c > public > 172.28.83.92 -Cr80 vtpVlanState.1.100 > CISCO-VTP-MIB::vtpVlanState.1.100 = No Such Instance currently exists > at this OID > > But if I use snmpbulkget and I will get result back: > > [jerhu...@snmplab-linux2 ~/performance_extra]$ snmpbulkget -v2c -c > public > 172.28.83.92 -Cr80 vtpVlanState.1.100 > CISCO-VTP-MIB::vtpVlanState.1.1002 = INTEGER: operational(1) But look at the index values that are listed. The entries are numbered from 1002 upwards. So there's nothing relevant under 'vtpVlanState.1.100' That's why the walk command is returning nothing. > CISCO-VTP-MIB::vtpVlanState.1.1003 = INTEGER: operational(1) > CISCO-VTP-MIB::vtpVlanState.1.1004 = INTEGER: operational(1) > CISCO-VTP-MIB::vtpVlanState.1.1005 = INTEGER: operational(1) ..... > ..... > CISCO-VTP-MIB::vtpVlanIfIndex.1.1002 = INTEGER: 65 > CISCO-VTP-MIB::vtpVlanIfIndex.1.1003 = INTEGER: 68 > CISCO-VTP-MIB::vtpVlanIfIndex.1.1004 = INTEGER: 66 > CISCO-VTP-MIB::vtpVlanIfIndex.1.1005 = INTEGER: 67 > CISCO-VTP-MIB::vlanInfo.2.1.0 = INTEGER: 1 > > So should I use snmpbulkwalk or snmpbulkget? It depends on exactly what you are trying to do. If you want an exact equivalent of the SNMP Research command, then use snmpbulkget. This will retrieve "the next 1000 entries" (or however many you specify) following the specified start point. But this is regardless of how these relate to the structure of the MIB. So the output mught cut off in the middle of the table, or it might spill over into the next section of the MIB. The GETBULK request doesn't care - it just gives you the next N entries. snmpbulkwalk is slightly more clever - it will give you everything under the specified starting point, and nothing more. So if the GETBULK results cut off part way through this subtree, it will send another request to get the rest of it. Alternatively, if the GETBULK results run off into the next section of the MIB, snmpbulkwalk will discard the irrelevant results. Try snmpbulkwalk ...... CISCO-VTP-MIB::vtpVlanTable to see the whole of this table (and nothing else) snmptable is more clever still - it can show the results of the walk so that they're layed out as a table (rather than the simple list of name/value pairs that snmp{bulk}walk displays) Try snmptable .... CISCO-VTP-MIB::vtpVlanTable to see this table as a table But of course, snmptable can *only* work with tables. It gets confused if you try to give it anything else. snmp{bulk}walk will show you any arbitrary subtree within the overall MIB. These are three different tools - which one is the right one depends on what you are trying to do. Dave ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
