【问题标题】:SNMP what is the correct way to interpret RMON2-MIB file?SNMP 解释 RMON2-MIB 文件的正确方法是什么?
【发布时间】:2014-09-16 08:51:32
【问题描述】:

我正在使用sharpsnmplib 开源库来编译MIB 文件并在我的自定义snmp 浏览器中使用它们。问题是Sharpsnmplib 无法编译RMON2-MIB 文件。使用它的后续库也无法编译。事实证明,(第一个)问题与文本(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 的文本约定解释器包含以下文本:

/* 
         * 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

有趣的是,TimeStamp 是 SNMPv2-TC 中定义的文本约定。 RMON2-MIB 定义了自己的使用时间戳的文本约定。 RMON2-MIB 中还有其他几个文本约定,它们引用了其他 MIB 文件中的文本约定。

因此,如果我没看错的话,RMON2-MIB 违反了 RFC2579。但是如果 RMON2-MIB 是主动使用的 MIB 文件,这就没有意义了。

我错过了什么?应该如何正确解释 RMON2-MIB?

【问题讨论】:

    标签: snmp sharp-snmp


    【解决方案1】:

    首先,#SNMP 的开源 MIB 解析器 SharpSnmpLib.Mib 有缺陷且已过时,因为 #SNMP Pro 有一个新的 SharpSnmpPro.Mib

    你发现的代码更老了(我的手工版本),所以我没想到它能够解析困难的 MIB 文档。

    其次,RMON2-MIB 是一个非常复杂的,因为它确实依赖于 SMIv2 核心 MIB 以及几个 SMIv1 的。这要求您正确定位所有依赖项(使用正确的副本,而不是从 Internet 下载损坏的副本)。

    第三,RFC 2579 和 RFC 4502 (RMON2-MIB) 之间没有冲突。 RMON2-MIB 定义了自己的使用 TimStamp 的文本约定,这没有什么特别或错误的。

    【讨论】:

    • 我做了一些额外的调查来检查我的一些文件是否如你所说的那样损坏。我一直使用this CISCO download page 作为主要的 MIB 文件源。每个文件有两个版本。我使用了 v2 文件,这就是发生问题的地方。 Sharpsnmplib 成功加载 v1 文件。事实证明,问题出在 v2 版本上,因此该库确实已过时。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-02
    相关资源
    最近更新 更多