❦  4 janvier 2016 17:15 +0100, Andreas Maus <[email protected]> :

> 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.

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).

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
the snmp module, it would be easy to add the appropriate check.
-- 
Use the "telephone test" for readability.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: signature.asc
Description: PGP signature

Reply via email to