From 6290c169f57cef10951c96d37e42eb3f5303e141 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 Apr 2019 08:46:50 -0400 Subject: [PATCH] Disable MIB resolution for raw requests MIB resolution turns out to be rather CPU intensive, and the current SNMP consumers don't want the resolution anyway. --- confluent_server/confluent/snmputil.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/snmputil.py b/confluent_server/confluent/snmputil.py index e862afe8..05090947 100644 --- a/confluent_server/confluent/snmputil.py +++ b/confluent_server/confluent/snmputil.py @@ -79,14 +79,16 @@ class Session(object): # overriden, but some devices only support DES) tp = _get_transport(self.server) ctx = snmp.ContextData(self.context) + resolvemib = False if '::' in oid: + resolvemib = True mib, field = oid.split('::') obj = snmp.ObjectType(snmp.ObjectIdentity(mib, field)) else: obj = snmp.ObjectType(snmp.ObjectIdentity(oid)) walking = snmp.bulkCmd(self.eng, self.authdata, tp, ctx, 0, 10, obj, - lexicographicMode=False) + lexicographicMode=False, lookupMib=resolvemib) try: for rsp in walking: errstr, errnum, erridx, answers = rsp