octet string conversion

Matthew ruach at chpc.utah.edu
Mon Jul 28 16:14:50 EDT 2003


I am working on some software that uses SNMP to get information from
routers and switches. I am using the pysnmp module (v2.0.8) to do the
snmp part. The problem that I am having is that when I query a router
for mac addresses pysnmp returns octetstrings like this:

\000\002\263\254\264\351
\010\000 \301F\021
\010\000 \300\303[
\000\002\263\254\264\241

what I need though is hex strings like this:

0:e0:7d:de:5:48
0:e0:7d:c8:dc:9f
8:0:36:4:3b:de
0:80:ad:3a:9e:2b

Can anyone tell me how to convert the octet strings to hex strings?

Thanks very much
-matthew




More information about the Python-list mailing list