IBM Tivoli Netcool/OMNIbus 8.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,但卻具有企業 ID 及設陷號碼,例如:

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 關鍵字,接著是 ::= 項目。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) 為止。請注意,在物件名稱及物件號碼之間不容許有空格。


程式庫 | 支援 |