NET-SNMP + Python Mac Address shows as \x00\ -


hey im trying mac-address via ipnettomediaphysaddress works fine when using netsnmp.snmpget command when saving variable(tuple?) , printing out via "print" mac-address looks this.

('\x00\n\xb7\x9c\x93\x80',)

code looks this,

mac = netsnmp.varbind("ipnettomediaphysaddress."+i+"."+ipadd) macadd = netsnmp.snmpget(mac, version = 2, desthost = ip, community = comm) print '%-15s' % macadd 

so need do? want normal mac address.

maybe call hexlify enough

from binascii import hexlify  mac = netsnmp.varbind("ipnettomediaphysaddress."+i+"."+ipadd) macadd = netsnmp.snmpget(mac, version = 2, desthost = ip, community = comm) print hexlify(macadd[0]) 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -