You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With snmpwalk I have this example output:
iso.0.8802.1.1.2.1.4.1.1.7.2520.9.1 = Hex-STRING: 31 2F 33 00
iso.0.8802.1.1.2.1.4.1.1.7.70039082.5.24 = Hex-STRING: 6C 20 56 54 93 D8
iso.0.8802.1.1.2.1.4.1.1.9.70039082.5.24 = STRING: "CISCO ATA SPA122"
With easysnmp I have unicode headache because of stupid compat module, which convert all to unicode even hex string, which is usually mac address.
Please add Hex-STRING snmp_type and return value as encode('hex') from latin1 string (not unicode string).
In this example '31 2F 33 00 ' is a normal string, but I dont see a way for now how to detect it, but what i defenetly need - preserve mac address as hex string (better non unicode).
If I use use_sprint_value=True, I have additionally double quotes, which not needed.
And integer type i want as integer, not unicode string.
The text was updated successfully, but these errors were encountered:
For anyone else that comes across this, while I agree the compat could use some help on OCTET STR types. A short work around that appears to be good and concise:
I'm sure there was some design reason behind using latin-1 encoding originally. But it does draw a good amount of confusion, especially with beginners. And the fragmentation of SNMP in Python doesn't help much.
With snmpwalk I have this example output:
iso.0.8802.1.1.2.1.4.1.1.7.2520.9.1 = Hex-STRING: 31 2F 33 00
iso.0.8802.1.1.2.1.4.1.1.7.70039082.5.24 = Hex-STRING: 6C 20 56 54 93 D8
iso.0.8802.1.1.2.1.4.1.1.9.70039082.5.24 = STRING: "CISCO ATA SPA122"
With easysnmp I have unicode headache because of stupid compat module, which convert all to unicode even hex string, which is usually mac address.
Please add Hex-STRING snmp_type and return value as encode('hex') from latin1 string (not unicode string).
In this example '31 2F 33 00 ' is a normal string, but I dont see a way for now how to detect it, but what i defenetly need - preserve mac address as hex string (better non unicode).
If I use use_sprint_value=True, I have additionally double quotes, which not needed.
And integer type i want as integer, not unicode string.
The text was updated successfully, but these errors were encountered: