2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 01:53:28 +00:00

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.
This commit is contained in:
Jarrod Johnson 2019-04-16 08:46:50 -04:00
parent 037ed43c70
commit 6290c169f5

View File

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