For better performance I have to migrate my bash script to python script... So I begin to use pysnmp and I'm facing an issue about output format...
You will find below netsnmp request:
snmpwalk -v 2c -c mycommunity 192.168.2.20 1.3.6.1.4.1.9.9.387.1.7.8.1.3
The same thing with pysnmp:
errorIndication, errorStatus, errorIndex, varBindTable = cmdGen.nextCmd(
cmdgen.CommunityData('mycommunity'),
cmdgen.UdpTransportTarget(('192.168.2.20', 161)),
'1.3.6.1.4.1.9.9.387.1.7.8.1.3'
)
With netsnmp I can change the output format like this:
snmpwalk -v 2c -Oa -c mycommunity 192.168.2.20 1.3.6.1.4.1.9.9.387.1.7.8.1.3
But I'm not able to change output format with pysnmp. How I can do it?