SNMP MIB SMIv2一致性组问题
我有一个开始工作的MIB,但是SNMP MIB SMIv2一致性组问题,snmp,asn.1,mib,Snmp,Asn.1,Mib,我有一个开始工作的MIB,但是smilint抱怨缺少一致性组。如何将此一致性组添加到我的文件中 BLEH-PRODUCT-MIB DEFINITIONS ::= BEGIN -- Objects in this MIB are implemented in the local SNMP agent. IMPORTS MODULE-IDENTITY, OBJECT-TYPE, Integer32, enterprises FRO
smilint
抱怨缺少一致性组。如何将此一致性组添加到我的文件中
BLEH-PRODUCT-MIB DEFINITIONS ::= BEGIN
-- Objects in this MIB are implemented in the local SNMP agent.
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Integer32, enterprises
FROM SNMPv2-SMI;
blehProductMIB MODULE-IDENTITY
LAST-UPDATED "201305290000Z"
ORGANIZATION "Bleh Corporation"
CONTACT-INFO " Joe Shmoe
Postal: Bleh Corporation
23 Telnet Road
Ottawa, ON, K1K 1K1
Canada
Tel: +1 555 555 5555 x5555
Fax: +1 555 555 5556
E-mail: joe.shmoe@bleh.com"
DESCRIPTION "MIB module describing Product objects."
REVISION "201305290000Z"
DESCRIPTION "Initial"
::= { bleh 911 }
bleh OBJECT IDENTIFIER ::= { enterprises 54321 }
productStatus OBJECT-TYPE
SYNTAX OCTET STRING (SIZE (0..65535))
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The status of the Product system
Details are shown as text"
::= { blehProductMIB 1 }
binaryProductStatus OBJECT-TYPE
SYNTAX Integer32 (0..1)
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The status of the Product system
Zero is unhealthy and One is healthy"
::= { blehProductMIB 2 }
END
smilint的输出
:
$ smilint ./BLEH-PRODUCT-MIB
./BLEH-PRODUCT-MIB:28: warning: node `productStatus' must be contained in at least one conformance group
./BLEH-PRODUCT-MIB:37: warning: node `binaryProductStatus' must be contained in at least one conformance group
它只是意味着您应该在MIB文档中定义对象类型实体之前定义对象组实体 以RFC1907为例 首先定义,然后
snmpInPkts OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The total number of messages delivered to the SNMP entity
from the transport service."
::= { snmp 1 }
关于为什么组很重要,您可以阅读RFC2580
因为您要定义组,所以建议添加相关的模块符合性。好的,但是oid呢?我应该把它设置成什么?另外,如何避免对象组引用警告?我需要一个模块合规部分吗?关于OID的选择没有严格的规定,但您可能会遵循行业最佳实践(例如,中的Cisco风格)。由于您将要定义组,因此建议添加关联的模块符合性。请将模块符合性部分添加到您的答案中,以便我可以接受它?
snmpInPkts OBJECT-TYPE
SYNTAX Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The total number of messages delivered to the SNMP entity
from the transport service."
::= { snmp 1 }