SNMP Mib。是"合格"在实践中使用的描述符

时间:2017-12-05 15:22:10

标签: snmp

根据标准 RFC 2578 3.2。导入符号

Note that when symbols from "enterprise-specific" information modules
are referenced  (e.g., a descriptor), there is the possibility of
collision.  As such, if different objects with the same descriptor
are IMPORTed, then this ambiguity is resolved by prefixing the
descriptor with the name of the information module and a dot ("."),
i.e.,

    "module.descriptor"

(All descriptors must be unique within any information module.)

Of course, this notation can be used to refer to objects even when
there is no collision when IMPORTing symbols.

一切似乎都很清楚,但...... 我无法在标准中找到它可以使用的地方,我找不到任何使用"合格的#34;描述符。

似乎没有人使用它。是真正的mib"合格"使用的描述符及其使用方式?

1 个答案:

答案 0 :(得分:1)

我为我的编译器产品编了一些测试用例,所以在这里发布以供参考。

TEST1-MIB模块将mytest定义为9998

TEST1-MIB DEFINITIONS ::= BEGIN
IMPORTS
    enterprises
        FROM SNMPv2-SMI;

mytest OBJECT IDENTIFIER ::= { enterprises 9998 }

END

TEST2-MIB模块将mytest定义为9999

TEST2-MIB DEFINITIONS ::= BEGIN
IMPORTS
    enterprises
        FROM SNMPv2-SMI;

mytest OBJECT IDENTIFIER ::= { enterprises 9999 }

END

然后当TEST3-MIB模块尝试导入两者时,我们需要前缀来确定将使用哪个mytest

TEST3-MIB DEFINITIONS ::= BEGIN
IMPORTS
    mytest
        FROM TEST1-MIB
    mytest
        FROM TEST2-MIB;

mytest1 OBJECT IDENTIFIER ::= { TEST2-MIB.mytest 9999 }

END