Garbaged SNMP values (tools)

  1. When fetching data with snmp*.py command-line tools, some values do not print out nicely:

 $ snmpget.py -v2c -c public 127.0.0.1 .1.3.6.1.4.1.14988.1.1.1.2.1.1.0.23.183.34.8.200.3
 SNMPv2-SMI::enterprises.14988.1.1.1.2.1.1.0.23.183.34.8.200.3 =
 OctetString: ˇČ

where Net-SNMP gives nicely formatted human-readable string:
 $ snmpget -v2c -c public 127.0.0.1 .1.3.6.1.4.1.14988.1.1.1.2.1.1.0.23.183.34.8.200.3
 SNMPv2-SMI::enterprises.14988.1.1.1.2.1.1.0.23.183.34.8.200.3 =
 Hex-STRING: 00 17 B7 22 08 C8

What can be done to PySNMP to make it returning HEX data in human-readable?
  1. The difference is that Net-SNMP prints values into hex by-default, whereas pysnmp does not do that. You can force snmpget.py to work similarily with the -OT command line parameter.

$ snmpget.py -OT -v2c -c public 127.0.0.1 .1.3.6.1.4.1.14988.1.1.1.2.1.1.0.23.
183.34.8.200.3
SNMPv2-SMI::enterprises.14988.1.1.1.2.1.1.0.23.183.34.8.200.3 =
OctetString: 00 17 b7 22 08 c8

Another matter is MIB lookup - when snmp*.py tool can use a MIB to figure out what are the display conventions for particular value type, it will reformat the value in a human-readable form.

To let MIB lookup work, please pass appropriate MIB name to snmp*.py tool through command line:

$ snmpwalk.py -m IP-MIB,IF-MIB -v2c -c public 127.0.0.1 .1.3.6.1.4.1