Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing an "snmpwalk" to a remote device. In response I get something like this:

.1.3.6.1.2.1.10.127.1.3.3.1.2.215 -> Hex-STRING: 24 37 4C 0C 65 0E 
.1.3.6.1.2.1.10.127.1.3.3.1.2.216 -> Hex-STRING: 24 37 4C 0B A2 DA 
.1.3.6.1.2.1.10.127.1.3.3.1.2.217 -> STRING: "$7L
                                                 f:"
.1.3.6.1.2.1.10.127.1.3.3.1.2.218 -> STRING: "$7L
                                                 k2"

As you can see some variables are of a STRING type, others are Hex-STRING. The correct output would only have Hex-STRING types.

So, I'm wondering whos fault is this? Does the remote device send the variable's type in responce? Or snmpwalk has to guess the type?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

All object types and names are defined in the MIB(s).

Without MIBs for the OIDs returned, snmpwalk can only show dot-names and raw data values.

Since you only get dot-names (and not MIB-defined object names) in the response, snmpwalk probably guesstimates what the object type is.

You can simply include the relevant (missing) MIB definition somewhere so snmpwalk can load it.

share|improve this answer

This mailing list post explains things; per RFC 2579, MIBs can contain a DISPLAY-HINT in their definition of variables. This defines how the data might be displayed; e.g. as a number to 2 decimal places, an ASCII string, etc.

You can pass snmpcmd options to snmpwalk such as -Oa or -Ox to force variables not having a display hint to be interpreted as ASCII or hex respectively; or you can use -d to dump the raw packets. The explanatory text for -Ih is quite informative, too:

disables the use of DISPLAY-HINT information when assigning values. This would then require providing the raw value:

snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0

               x "07 D2 0C 0A 02 04 06 08"

instead of a formatted version:

snmpset ... HOST-RESOURCES-MIB::hrSystemDate.0

               = 2002-12-10,2:4:6.8 

The best place to find fine detail on the SNMP standard is of course the relevant RFCs; the O'Reilly book Essential SNMP is probably worth a read, too.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.