SNMP Check Plugin Problem

Hey everybody,
i wrote a check plugin to monitor interfaces bandwith via snmp. The Counter64 is shown in Hex via SNMP. CheckMK gives me the wrong values because of Unicode translation.

Here is an example:

Thats the output after CheckMK gets it via SNMP:
u’\x00\x00\x00\x01\x0f\x1f\xfe’

This is what it should look like:
u’\x00\x00\x00\x01\x0f\x1f\xc3\xbe’

This is the original SNMP Counter64 from snmpget or walk:
00 00 00 01 0f 1f c3 be

CheckMK translate \xc3\xbe to \xfe because of unicode utf8 hex. \xc3\xbe is the utf8 hex for \xfe. But i want the original SNMP Counter64 hex. The Problem is the hex value has now seven instead of eight values, then you get wrong bandwith. I can retranslate it but how do you want to know if it is original \xfe and not \xc3\xbe and on which value position. How ever, how can i stop the translation in a check with checkmk (python).

Why does the SNMP-agent on this device return a hexstring for a counter64 attribute?

What is the data type in the MIB for this OID?

I have already talked with the Hardware manufacturer and they won’t give me the mib and they said that’s normal for this type of devices, that they give counter64 as hex string, i should build a script which translate it to decimal. The script isn’t the problem, translating hex to decimal is easy but not if you get wrong hex because of CheckMK.

Drop that device and find a replacement. It is not monitorable.

Please publish manufacturer and device names so that others can avoid to purchase it.

What device is this? It would be interesting to know.

Don’t say this too loud - I had some medicine devices with such “nice” behavior and also and motorway emergency telephones system from Siemens with nearly the same strange things. But there you cannot select an supplier :smiley:

It’s a Nokia Isam.

If Check MK would give me the hex String from SNMP and not the modified crap that come with snmp.py i think, then i could easy monitor it. My check can handle it ca. 95% but the described problem can’t be solved via code because the input is already wrong and can’t be retranslated safely.

With the legacy check API you could say that a OID is binary.
I would try to look at the output with this setting.
An example is this check “arista_bgp” it fetches somes OIDs as binary and later parse this data.

There exists some other checks who also receive binary data from OIDs.

Thanks for this hint that’s it!!! I had already the solution in my oid list with the mac address but didn’t saw it… Thats the Solution, you can declare oids as binary, so checkmk wouldn’t give you an UTF8 String, it will give you a Byte list. You can format it as hex and thats it. Here is the link for that feature/werk that solve exact this Problem i got…:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.