On Mon Jan 04, 2016 at 20:02:16PM +0100, Vincent Bernat wrote: > ❦ 4 janvier 2016 17:15 +0100, Andreas Maus <maus+debian...@ypbind.de> : > > > Using the snimpy.snmp.walk() method to retrieve SNMP data > > returns more data than expected if the SNMP version > > is not 1. It seems the walk result includes the OIDs > > from the tree "above". > > This works as "expected" with SNMPv1 since the module will use GETNEXT > instead of GETBULK and therefore will know how to stop at the right > place. Yes, I'm aware of the difference. I thought walk() will behave like the snmpbulkwalk command when walking the tree and get() like snmpbulkget.
> When using GETBULK and getting extra results, the pruning is done later > in the manager. The "snmp" module is just an helper for the "manager" > module. I didn't think that so many users would use it directly. The > documentation of the method says that the name is deceptive as this > method is really GETNEXT/GETBULK in a loop (and in fact, this is just a > thin wrapper on top of a similar function in PySNMP which does the same). And I'm trying to stay away from using pysnmp directly, although the changes in pysnmp 4.3 look a little more "sane" to use ;) > I would suggest to use the manager class instead (but you need to use > MIB) as it is the primary target for Snimpy. If you really want to use O.k. using the MIB instead of the numerical representation will be the next step, so I will use the manager class. > the snmp module, it would be easy to add the appropriate check. That would be "nice to have". Sorting out the unwanted results is what I'm doing when I have to use the numeric OID. Case closed. Sorry for the noise. So long, Andreas. -- "Things that try to look like things often do look more like things than things. Well-known fact." Granny Weatherwax - "Wyrd sisters"
signature.asc
Description: Digital signature