diff --git a/config.py b/config.py index 6eb0ebb3e2aa60681c5fb1cc3fc3886653a24202..ed61e0d2c3671e51a1ff64dac68d976fd6f0a57f 100644 --- a/config.py +++ b/config.py @@ -44,26 +44,21 @@ def walk(agent_hostname, community, base_oid): UdpTransportTarget((agent_hostname, 161)), ContextData(), ObjectType(ObjectIdentity(base_oid) - .addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@')), + .addAsn1MibSource('http://mibs.snmplabs.com/asn1/@mib@')), lexicographicMode=False, lookupNames=True, lookupValues=True): assert not engineErrorIndication assert not pduErrorIndication assert errorIndex == 0 + varBinds = [ + rfc1902.ObjectType(rfc1902.ObjectIdentity(x[0]),x[1]) + .resolveWithMib(mibViewController) + for x in varBinds] for oid, val in varBinds: print("\toid: '%s', val: '%s'" % ( oid.prettyPrint(), val.prettyPrint())) - zzz = [ - rfc1902.ObjectType(rfc1902.ObjectIdentity(x[0]),x[1]) - .resolveWithMib(mibViewController) for x - in - varBinds] - for z in zzz: - print('zzz: %s' % z.prettyPrint()) - - def _validate_config(ctx, param, value): """ loads, validates and returns configuration parameters