Skip to content

Printable_Characters_and_Hexadecimal_Output_from_the_tools

Bill Fenner edited this page Aug 30, 2018 · 1 revision

Question

When I do an snmp walk on part of the mib space, some objects that normally return a string type are instead returning hexadecimal characters, yet they identify the oid type as string instead of hex string.

Answer

SNMP only has one type of data for strings, OCTET STRINGs is the SMI data type for sending strings through the SNMP protocol. It's Net-SNMP that decides whether to print a string as a human-formatted string or a hexadecimal string. And, in turn, Net-SNMP leaves that decision up to the system.

Making Strings Human Readable

The Net-SNMP tools all decide whether or not to print a character in a string directly to the output stream based on whether that character passes the system's isprint() test. Specifically, this means that whether or not the tools decide a character is printable is determined by your locale settings and what your default language is.

If you are seeing hexadecimal strings when you would like to see human-readable strings, you need to identify which characters are causing the issue and convince your system that they are printable.

Forcing Hexadecimal Display

hmm... how come the -Ox and -Oa options aren't working?

Possible answer: -Ox and -Oa do not override the DISPLAY-HINT if there is one. Try adding -Ih which disables the use of DISPLAY-HINT information: Quester (talk)

Category:Applications Category:Output

Clone this wiki locally