11

作業を開始した 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
4

2 に答える 2

10

これは単に、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 を追加することをお勧めします。

于 2013-05-30T03:19:28.903 に答える