This is a discussion on Re: Strange error in test program... within the SNMP Coders forums, part of the Networking and Network Related category; On 08/04/2008, Kris van Rens <krisvanrens.list@gmail.com> wrote: > > You are also assuming ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 08/04/2008, Kris van Rens <krisvanrens.list@gmail.com> wrote:
> > You are also assuming that ifTable entries will always be > > in a strict consecutive sequence (starting from 1). That's > > probably true for most simple systems, but it's not guaranteed. > > It is perfectly valid to have 3 interfaces, with indexes 2, 3 > > and 27, for example. > > > Mmm...ok. I could send another PDU to get the ifIndex.x list...this > works but needs another PDU. But how do you know which ifIndex.{x} values to ask for? The {x} there is the same as the {x} in the ifPhysAddress.{x} OID. So this is just moving the problem (unnecessarily). This is where GETNEXT (or GETBULK) comes in. In fact, with GETNEXT, you don't need to retrieve ifNumber.0 in the first place. Just start walking the ifPhysAddress column, and stop when you fall off the end. See"snmpwalk" for how this works. GETBULK has the advantage that you can send one request (for 'ifPhysAddress' with no index subidentifier) and ask for the next N values. The response would give you the full contents of this column, regardless of the index values. But that only works with SNMPv2 Dave ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757...un.com/javaone _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|