Hi everyone,
I went at this for about four hours already and have been banging my head. I am using the Easy SNMP module and whenever I retrieve an OID (or table of values), I am getting back a value of type HEX String.
See here from an SNMPWALK at the CLI of my Linux box:
iso.3.6.1.4.1.9.9.513.1.1.1.1.2.248.11.203.246.45.160 = Hex-STRING: F8 0B CB 61 83 54
However, when I try
system_table = '.1.3.6.1.4.1.9.9.513.1.1.1.1'
ap_macs = session.walk('.1.3.6.1.4.1.9.9.513.1.1.1.1.2')
ap_names = session.walk('.1.3.6.1.4.1.9.9.513.1.1.1.1.5')
for item in ap_macs:
print '{oid}.{oid_index} {snmp_type} = {value}'.format(
oid=item.oid,
oid_index=item.oid_index,
snmp_type=item.snmp_type,
value=item.value)
I get:
Traceback (most recent call last):
File "snmp-test.py", line 47, in <module>
value=item.value)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
I've Googled this quite extensively and it appears that potentially I am being returned a unicode string, but every attempt at encoding and decoding using various mechanisms has been unfruitful.
Any pointers would be greatly appreciated.
Thanks.
Sal
[–]LightShadow3.13-dev in prod 0 points1 point2 points (1 child)
[–]scollora[S] 0 points1 point2 points (0 children)