IBM Tivoli Netcool/OMNIbus V8.1

有效的 MIB 对象格式

本主题描述了有效 MIB 对象的格式。

以下几节描述了有效的 SNMP MIB 对象格式。

TEXTUAL-CONVENTION

v2 TEXTUAL-CONVENTION (TC) 的格式如下(其中,对象名后面跟有 ::= 条目以及 TEXTUAL-CONVENTION)。随后是若干个段,段后附加了 SYNTAX 定义。

DisplayString ::= TEXTUAL-CONVENTION 
DISPLAY-HINT "255a" 
STATUS current 
DESCRIPTION "Represents textual information taken from the NVT SCII character set, as defined in pages 4, 10-11 of RFC 854. To summarize RFC 854, the NVT ASCII repertoire specifies: - the use of character codes 0-127 (decimal) - the graphics characters (32-126) are interpreted as US ASCII - NUL, LF, CR,BEL, BS, HT, VT and FF have the special meanings specified in RFC 854 - the other 25 codes have no standard interpretation - the sequence 'CR LF' means newline - the sequence 'CR NUL' means carriage-return - 
an 'LF' not preceded by a 'CR' means moving to the same column on the next line. - the sequence 'CR x' for any x other than LF or NUL is illegal. (Note that this also means that a string may end with either 'CR LF' or 'CR NUL', 
but notwith CR.) Any object defined using this syntax may not exceed 255 characters in length." 
SYNTAX OCTET STRING (SIZE (0..255))

v1 TC 由跟有 ::= 条目的对象名以及随后附带的有效 SYNTAX 定义组成。例如:

DisplayString ::= OCTET STRING

这两个对象都存在于 MIB 树外部,因此不是 MIB 中的对象。它们表示可为其定义语法的格式。它们没有 OID。您可以通过单独的过滤器在“MIB 模块”中对它们进行查看,方法是单击查看下拉列表,然后选择文本约定

TRAP-TYPE 对象

TRAP-TYPE 对 v1 MIB 有效。最初定义这些对象的时候,并非为了将它们用于 MIB 树。它们没有 OID,而有企业标识和陷阱号,例如:

newRoot TRAP-TYPE 
ENTERPRISE dot1dBridge 
DESCRIPTION "The newRoot trap indicates that the sending agent has become the new root 
of the Spanning Tree; the trap is sent by a bridge soon after its election as the new 
root, e.g., upon expiration of the Topology Change Timer immediately subsequent to its 
election." 
::= 1

v1 陷阱以对象名开头,后跟关键字 TRAP-TYPE。随后跟有若干个段,最后以 ::= 条目和一个数字结尾。数字前后都不使用大括号 ({})。

MACRO 对象

MACRO 对象定义了其他 MIB 对象的格式。MACRO 定义始终以对象类型开头,后跟关键字 MACRO,然后是 ::= 条目。宏定义的剩余部分包含在 BEGINEND 标记之间,例如:

OBJECT-TYPE MACRO ::= 
BEGIN
TYPE NOTATION ::= "SYNTAX" 
type (TYPE ObjectSyntax) "ACCESS" Access "STATUS" Status VALUE NOTATION ::= value 
(VALUE ObjectName) Access ::= "read-only" | "read-write" | "write-only" | "not-accessible" 
Status ::= "mandatory" | "optional" | "obsolete" 
END

其他对象

所有其他对象都必须符合以下格式:
snmpInPkts OBJECT-TYPE SYNTAX Counter ACCESS read-only STATUS mandatory DESCRIPTION
 "The total number of Messages delivered to the SNMP entity from the transport 
service." ::= { snmp 1 }

这些对象以对象名开头,并且该对象名必须以小写字母字符开头。此对象名之后跟有一个指示对象类型的关键字。此关键字之后是任何其他段以及 ::= 条目,格式的最后是包含在大括号 ({}) 中的祖代列表。大括号 ({}) 内的这些祖代采用两种格式之一。第一种格式(如上所示)是对象名后跟一个数字。对象名是此对象的直接父级的名称,数字是此对象在父级中的叶子编号。

祖代列表的第二种有效格式是已知对象后跟所有祖代的列表,例如:
internet OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 } 

在此示例中,列表从一个已知对象(作为树根的 iso)开始,然后继续定义每个后代的对象名和叶子编号,即 org(3)dod(6),直至表示对象编号的一个最终整数 (1)。请注意,对象名与对象编号之间不允许存在空格。


| 支持 |