Some tools can help you to check your MIB documents and MIB modules. The document "Guidelines for Authors and Reviewers of MIB Documents [RFC4181, BCP111]", for example, requires that a MIB module adhere to the syntax rules as per the SMIv2 specification [RFC2578, RFC2579, RFC2580].
There is no requirement that a MIB module passes a specific MIB compiler. The requirement is that the syntax is correct.
So the following is not a promotion of any specific tool, but rather a pointer to a few tools that are often used by MIB reviewers. That does not endorse these specific tools, nor does it mean that other tools might not do a similar or better job at checking.
smilint is part of the open-source libsmi package maintained by Frank Strauss of the Technical University of Braunschweig; see http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information and downloading instructions.
The first tool is smistrip to extract all the MIB modules out of a internet-draft or other ASCII based text document.
By default, the smilint program does only minimal checking, and in a MIB review one generally wishes to run the program at maximum complaint level, discarding only those warnings pertaining to names longer than 32 characters:
where <module> is replaced with the file name of the module being compiled. A full pathname is required unless it resides in one of the standard MIB directories (see the program documentation for more information).
There is a related utility called smidiff that is useful for checking whether updates to a previously-published MIB module conform to the SMIv2 rules on revisions. Command line options similar to those above are recommended.
An example (using the Internet-Draft that became RFC 3584) for syntax checking the SNMP-COMMUNITY-MIB and then checking any changes since the previous version is as follows:
First extract the previous version
For those who are unable or unwilling to compile and install smilint and smidiff locally, there is a WEB service that can be used instead. In order to check a MIB module via the WEB interface, goto http://www.ibr.cs.tu-bs.de/projects/libsmi/tools/ and follow the instructions to fill out the required fields.
SMICng is a commercial program available from SNMPinfo; see http://www.snmpinfo.com/ for more information.
As a rule, MIB modules are not compiled directly with SMICng but rather are referenced by a SMICng include file, which mentions the modules from which symbols are imported and contains any module-specific compilation options. For the purposes of doing MIB reviews, selecting maximally picky compilation switches is usually the right thing to do. A sample include file (for the SNMP-COMMUNITY-MIB (using draft-ietf-snmpv3-coex-v2-04.txt which is now RFC 3584) is shown below.
SMICng comes with a program to extract a MIB module from an internet-draft or other ASCII based text document.
Let us go through the steps for the SNMP-COMMUNITY-MIB
The MIB doctors often use a more strict checking
This may generate Errors and Warnings that are potentially acceptable, but they can also indicate serious trouble. Please evaluate such errors and warnings and if in doubt, check with the MIB doctors or on the ietfmibs@ietf.org mailing list.
The include file generated above looks as follows: