Unicode Symbols insted of mac

I’m writing a check which should contain a Mac address. However, the output is already shown wrong in the inventory function. The data is displayed correctly in the snmpwalk.
The Mac has the format “xx xx xx xx xx xx”

Hey @Maxi, can you post an example of how the output is shown wrong?

I’m working on an snmp check currently (ISIS-MIB) which you’ll see a post in this forum. I had to convert some ascii hex values, this might be what you need to do also.


Sounds like the same problem.
This is the output in the Frontend
Accesspoint: online ( kñÌw€)
Accesspoint: online ( ,3#—¨)
Accesspoint: online ( ,3#¼)

best regards

Hi Maxi,

I was experimenting with the different formats available as I was learning how to convert, so below is binary, hex and decimal outputs. The main functions are .join, .format, and ord() and you can use different sepearators as I did below with space ’ ', colon ‘:’ and dot ‘.’ as I did in the example below.

z = ' kñÌw€'

print('z:' + z)
print('zlen:' + str(len(z)))

zbin = ' '.join('{:08b}'.format(ord(x), 'b') for x in z)
print('zbin:' + zbin)

zhex = ':'.join('{:02x}'.format(ord(x), 'x') for x in z)
print('zhex:' + zhex)

zdec = '.'.join(format(ord(x), 'd') for x in z)
print('zdec:' + zdec)

z: kñÌw
zbin:00100000 01101011 11110001 11001100 01110111 10000000

Hope this helps!


1 Like

Perfekt Solution.
Works like a charm