SNMP MIB SMIv2 Conformance Group Issue

女生的网名这么多〃 提交于 2019-12-10 02:13:47

问题


I have a MIB that I started working on but smilint complains about a missing conformance group. How do I add this conformance group to my file?

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

Output of 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

回答1:


It simply means you should define OBJECT-GROUP entities before defining OBJECT-TYPE entities in your MIB document.

Take RFC 1907 as example,

http://tools.ietf.org/html/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 }

is defined first, and then

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 }

About why groups are important, you can read RFC 2580.

http://tools.ietf.org/html/rfc2580

Since you are going to define groups, then adding associated MODULE-COMPLIANCE is recommended.



来源:https://stackoverflow.com/questions/16823593/snmp-mib-smiv2-conformance-group-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!