From Boldcore's wiki
Jump to: navigation, search
(Created page with "==PySNMP do not dive to other OIDs== I am new to this topic, but lets say, that I want from PySNMP only one OID "tree". By default, it will jump to another and print all remai...")
 
 
Line 18: Line 18:
 
</pre>
 
</pre>
  
Then You can print the varBinds, the way You prefer.
+
Then You can print the varBinds, in the way You prefer.

Latest revision as of 04:34, 31 May 2017

PySNMP do not dive to other OIDs

I am new to this topic, but lets say, that I want from PySNMP only one OID "tree". By default, it will jump to another and print all remaining OIDs.

Here's the magic:

lexicographicMode=False
for (errorIndication, errorStatus, errorIndex, varBinds) in nextCmd(SnmpEngine(),
 UsmUserData(user, authpass, cryptpass,
 authProtocol=RetizekProkotol,
 privProtocol=NSACrypt1),
 Udp6TransportTarget(('2a02:cafe:c001:face:bad:f00d', 161)),
 ContextData(),
 ObjectType(ObjectIdentity('1.3.6.bla.bla.oid')),
 lexicographicMode=False):

Then You can print the varBinds, in the way You prefer.