snmpsharp-snmp

SNMP what is the correct way to interpret RMON2-MIB file?


I'm using sharpsnmplib open source library to compile MIB files and use them in my custom snmp browser. The issue is that sharpsnmplib cannot compile RMON2-MIB file. And subsequent libraries that use it cannot be compiled as well. As it turns out, the (first) issue is with the text (RMON2-MIB.txt):

LastCreateTime ::= TEXTUAL-CONVENTION
    STATUS current
    DESCRIPTION
        "This TC describes an object that stores the last time its
        entry was created.

        This can be used for polling applications to determine that an
        entry has been deleted and re-created between polls, causing
        an otherwise undetectable discontinuity in the data."
    SYNTAX TimeStamp

Sharpsnmplib’s textual convention interpreter contains this text:

/* 
         * RFC2579 definition:
         *       Syntax ::=   -- Must be one of the following:
         *                    -- a base type (or its refinement), or
         *                    -- a BITS pseudo-type
         *               type
         *             | "BITS" "{" NamedBits "}"
         *
         * From section 3.5:
         *      The data structure must be one of the alternatives defined
         *      in the ObjectSyntax CHOICE or the BITS construct.  Note
         *      that this means that the SYNTAX clause of a Textual
         *      Convention can not refer to a previously defined Textual
         *      Convention.
         …

Sharpsnmplib interpreter’s source

RMON2-MIB

RFC 2579

Interesting thing is that TimeStamp IS the textual convention defined in the SNMPv2-TC. And RMON2-MIB defines its own textual convention that uses TimeStamp. There are several other textual conventions in the RMON2-MIB that refer textual conventions from other MIB files.

Thus, if I’ve got it right, RMON2-MIB violates RFC2579. But this doesn’t make sense if RMON2-MIB is actively used MIB file.

What am I missing? How should the RMON2-MIB be properly interpreted?


Solution

  • First, #SNMP's open source MIB parser SharpSnmpLib.Mib is buggy and obsolete, as #SNMP Pro has a new SharpSnmpPro.Mib.

    The code you found was even older (my handmade version), so I never expected it able to parse difficult MIB documents.

    Second, RMON2-MIB is a very complex one, as it does rely on both SMIv2 core MIBs, as well as several SMIv1 ones. That requires you to have all dependencies properly located (using the correct copies, instead of downloading corrupt ones from the Internet).

    Third, there is no conflict between RFC 2579 and RFC 4502 (RMON2-MIB). RMON2-MIB defines its own textual convention that uses TimStamp and that's nothing special or wrong.