
= SNMP MIB Compiler
:description: Learn how to import a MIB file and create event definitions in {page-component-title}.

Management Information Base (MIB) files are text files written in https://en.wikipedia.org/wiki/ASN.1[Abstract Syntax Notation].
They describe Simple Network Management Protocol (SNMP) elements for specific devices.
By default, {page-component-title} includes an extensive list of MIB definitions from a number of vendors.
You will only need to import MIB files for unformatted events as part of configuring SNMP traps and collection.

You can parse SNMP MIB definitions and create {page-component-title} event definitions from any `TRAP-TYPE` or `NOTIFICATION-TYPE` macros that they contain through the UI.
You can also generate data collection definitions from `OBJECT-TYPE` symbols defined in a MIB file.

You can use the `mib2opennms` command line utility to help create event definitions from MIB definitions.
Using the UI editor achieves similar results to using `mib2events`.

NOTE: We do not recommend using `mib2opennms`, as it produces more bus errors than event definitions.

[[mib-import]]
== Import MIB and create event definitions

To import a MIB file and create event definitions, follow these steps:

. Save the vendor MIB file to a location available to your local workstation.
The MIB file does not need to be accessible by the server.
. Go to the web UI.
. Click menu:Tools[SNMP MIB Compiler] in the side menu.
. Or, click menu:Administration[Configure OpenNMS] in the side menu, then under *Additional Tools*, click *SNMP MIB Compiler*.
. Click *Upload MIB*.
. Select the MIB file and click *Open*.
. Right-click the file and choose *Compile MIB*.
. If the log area displays an error (usually a missing dependency), you must correct the error to compile the MIB file successfully.
** Determine the type of error (dependency, file syntax).
** Search the internet for the name of the missing content, save it as a text file, upload it, and compile again.
+
OR

** Right-click the file and choose *Edit MIB*.
** Edit the file to address the error, click *Save*, and compile it again.
. Continue to edit the file until it compiles successfully.
. Right-click the MIB from which you want to generate an event and choose *Generate Events* or *Generate Data Collection*, as appropriate.
. If desired, modify the name of the UEI base with the vendor name for easier troubleshooting and click *Configure*.
. Click *Save Events File* to save them to the `event.conf` file.

If you were getting unformatted events, they will now be formatted.
