[Pysnmp-dev] converting from pyASN ObjectString, Integer to python types
Brought to you by:
elie
From: Zorg 4. <zor...@gm...> - 2009-03-19 12:41:21
|
Hello pysnmp users, How do I convert the snmp values returned by pysnmp without resorting to a priori knowledge on the ASN type in the table column I'm interested (like using int(prettyPrint()) ) Example: ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 17, 24], Integer('1')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 17, 25], Integer('1')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 17, 26], Integer('1')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 17, 27], Integer('2')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 17, 28], Integer('2')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 1], OctetString('Test SNMP query fifi')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 2], OctetString('libre')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 3], OctetString('free')), ([1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 18, 4], OctetString('unused')), Is there a commonly named method for each pyASN type which return a python int, string etc... ? Regards. |