snmpcollector interface descriptions truncated

Document ID : KB000124236
Last Modified Date : 08/01/2019
Show Technical Document Details
Issue:
snmpcollector appears to be truncating the ifAlias/IfDescription values. On a particular interface, we have an interface that has been truncated. In an editor you can see that at char 63 is the letter “A” and at char 64 it is a space. snmpcollector does not show it therefore it never gets the interface. Most of our co-lo Interface descriptions would be cut off and not valid.
Environment:
- snmpcollector v3.44
- UIM 8.5.1 or higher
Cause:
= IF-MIB attribute value limitations
Resolution:
As per the IF-MIB: 

   ifDescr 1.3.6.1.2.1.2.2.1.2 DisplayString ( SIZE ( 0..255 ) ) 

   IfAlias 1.3.6.1.2.1.31.1.1.1.18 DisplayString ( SIZE ( 0..64 ) ) 

For ifAlias, this is a limitation for the ifAlias field according to the IF-MIB: 

ifAlias OBJECT-TYPE
SYNTAX DisplayString (SIZE(0..64))
MAX-ACCESS read-write
STATUS current
DESCRIPTION

By default, the maximum length for ifAlias is 64 characters. IfDescr is a read-only attribute in the MIB but ifAlias can be overwritten by snmp ifmib alias long in global configuration mode which allows up to 255. If the ifAlias values are not configured using the snmp ifmib ifalias long command, the ifAlias description will remain restricted to 64 characters. This is by MIB design, and has nothing to do with snmpcollector. Note that if you decided to overwrite it, management interfaces may be adversely affected,as you may overflow the MIB variable in the interface so probably not advisable.

To assess/confirm, simply run a vendor certification test on the given device. It should show the ifAlias and ifDescr OIDs/values. 

IfAlias will be truncated to 64 and that is expected as per the limitation in the MIB.

IfDescr

ifDescr OBJECT-TYPE
    SYNTAX      DisplayString (SIZE (0..255))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
            "A textual string containing information about the
            interface.  This string should include the name of the
            manufacturer, the product name and the version of the
            interface hardware/software."
    ::= { ifEntry 2 }

See https://tools.ietf.org/html/rfc2863
Additional Information:
80 characters is possible with "snmp ifmib ifalias long" on new Cisco OSes. This does not work however for Nexus OS, which means there is no good reason to enable it if you cannot say it is configurable across the board.

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/snmp/configuration/15-sy/snmp-15-sy-book/nm-snmp-cfg-snmp-support.html