Template:FAQ:Applications 15b
There are two ways of encoding variable-length string index values within an OID. The first approach (which can be used anywhere in a list of index values) is to give the length of the string value, followed by the individual characters:
"wes" = 3 'w' 'e' 's'
The other approach (which can only be used with the very last index object of a table) is simply to list the individual characters directly:
"wes" = 'w' 'e' 's'
This second approach is indicated by the token
IMPLIED
in the INDEX
clause in the MIB table definition.
This is also used for fixed-length index values,
where the number of characters is explicitly
specified in the MIB file.
When working with string index values, the Net-SNMP
client tools use double quotes (i.e. "wes"
)
to indicate the first (explicit-length) form,
and single quotes (i.e. 'wes'
)
to indicate the second (implicit-length) form.