Solaris System Management Agent Developer's Guide

Defining a MIB

MIB definition is one of the more time-consuming steps of creating a module. MIB syntax can be quite complicated, and is outside the scope of this document. Refer to Related Reading for suggestions of other sources of information about MIB syntax.


Tip –

The mib2c tool, used for converting MIBs to C code, includes error checking for MIB syntax. You can use mib2c to check your MIB syntax as you create your MIB, even before you are ready to convert the MIB.


You should consider using one of the standard MIBs that are included with the SMA as a model for creating your MIB. The /etc/sma/snmp/mibs directory contains all the standard MIBs supported by the SMA.

The following MIBs can be used as examples to emulate because the MIBs have been found to work well with mib2c:


Tip –

Pay particular attention to the name that is assigned for the MODULE-IDENTITY. This name should be equal to the MIB file name with the hyphens removed, and in mixed case. For example, SUN-SEA-EXTENSIONS-MIB.txt uses sunSeaExtensionsMIB for the MODULE-IDENTITY. A MIB file that does not use this format might not work with mib2c.


The file NET-SNMP-EXAMPLES-MIB.txt is also included in the /etc/sma/snmp/mibs directory, and might be helpful in explaining how to define a variety of MIB variable types.

MIB File Names

You must ensure unique names for your MIB files. All custom MIBs to be used with SMA are in the same namespace as the standard MIBs, even if you keep the custom MIBs in a separate directory. Most of the MIBs derived from RFCs have RFC numbers in their names to clearly identify the MIBs, and ensure unique names. Other MIBs follow naming conventions, which decrease the chances of duplicate names.

MIBs are usually named with the following conventions:

A sample name that uses these conventions is ACME-ROUTER-MIB.txt.