I need to find the object name and data type for a given OID. I can get the name, but can't find the functionality in PySNMP to also return the data type (integer, octet string, counter...).
What I have so far (example):
from pysnmp.smi import builder, view, compiler
mibBuilder = builder.MibBuilder()
compiler.addMibCompiler(mibBuilder, sources=['/usr/share/snmp/mibs'])
mibBuilder.loadModules('IF-MIB', ...)
mibView = view.MibViewController(mibBuilder)
oid, label, suffix = mibView.getNodeName((1,3,6,1,2,1,31,1,1,1,6))
print(label)
This returns the name for the oid (ifHCInOctets) but I also need it to return the data type, which in this case would be Counter.
Is there a function in PySNMP to find the data type?