pysnmp icon indicating copy to clipboard operation
pysnmp copied to clipboard

nextCMD, Incorrect index conversion?

Open x-stride opened this issue 4 years ago • 0 comments

Hello guys,

I've been using pysnmp.hlapi.asyncio.nextCmd like this to access tables:

(errorIndication, errorStatus, errorIndex, varBinds) = await pysnmp.hlapi.asyncio.nextCmd(
    self.snmpEngine,
    pysnmp.hlapi.auth.CommunityData(communityIndex=self.__community, mpModel=self.__version),
    pysnmp.hlapi.asyncio.transport.UdpTransportTarget((self.__host, 161)),
    pysnmp.hlapi.context.ContextData(),
    *varBinds,
    lookupNames=True, lookupValues=True, lexicographicMode=False
)

I'm able to access IF-MIB perfectly fine with these varBinds: image

But getting an error on IP-MIB::ipAddressTable using these: image

Error: image

An snmptable command reveals: snmptable -Ob -Ci -v 2c -c public localhost IP-MIB::ipAddressTable

Indexes: 1.4.10.0.0.1 1.4.10.0.0.255 etc...

Is this a bug in the pysnmp library, or am I accessing the table wrong?

x-stride avatar Jun 19 '20 11:06 x-stride