2013-05-29 15 views
7

私が作業を開始したMIBはありますが、smilintは欠落している準拠グループについて文句を言います。この適合性グループをファイルに追加するにはどうすればよいですか? smilintSNMP MIB SMIv2準拠グループの問題

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: [email protected]" 
    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 ./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 

答えて

7

それは単にあなたがあなたのMIBドキュメントにOBJECT-TYPEエンティティを定義する前に、オブジェクト・グループのエンティティを定義するべきであることを意味します。

テイクRFC 1907例として、

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 } 

が最初に定義され、その後、グループが重要である理由について

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

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

グループを定義する予定なので、関連するモジュール対応を追加することをお勧めします。

+0

大丈夫ですが、oidはどうですか?どうすればいい?また、どのようにオブジェクトグループ参照の警告を避けるのですか?モジュール・コンプライアンス・セクションが必要ですか? –

+0

OIDの選択についての厳密なルールはありませんが、業界のベストプラクティス(たとえば、http://tools.cisco.com/Support/SNMP/do/BrowseMIB.do?local=en&step=2&submitClickedのCiscoスタイル= true&mibName = CISCO-IETF-DOT11-QOS-MIB#依存関係)。グループを定義しようとしているので、関連するMODULE-COMPLIANCEを追加することをお勧めします。 –

+0

MODULE-COMPLIANCEセクションを回答に追加して受け入れることができますか? –