gpt4 book ai didi

SNMP MIB SMIv2 一致性组问题

转载 作者:行者123 更新时间:2023-12-02 01:26:59 25 4
gpt4 key购买 nike

我已经开始研究一个 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
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 文档中定义 OBJECT-TYPE 实体之前定义 OBJECT-GROUP 实体。

以RFC 1907为例,

https://www.rfc-editor.org/rfc/rfc1907

snmpGroup OBJECT-GROUP
OBJECTS { snmpInPkts,
snmpInBadVersions,
snmpInASNParseErrs,
snmpSilentDrops,
snmpProxyDrops,
snmpEnableAuthenTraps }
STATUS current
DESCRIPTION
"A collection of objects providing basic instrumentation and
control of an SNMPv2 entity."
::= { snmpMIBGroups 8 }

先定义,然后

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 }

关于为什么组很重要,您可以阅读 RFC 2580。

https://www.rfc-editor.org/rfc/rfc2580

由于您要定义组,因此建议添加关联的 MODULE-COMPLIANCE。

关于SNMP MIB SMIv2 一致性组问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16823593/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com