Loading MIBs

 

Follow the steps given below to load a MIB file.

  1. Click the Load MIB Module button or select File-->Load MIB from the menu. Alternatively, you can use the shortcut combination Ctrl + O. This displays the Load a Mib File dialog box as shown below.

  1. In the Load a Mib File dialog box, select the MIB file from the mibs folder.

There are other options for loading the MIB file. Click the Recent tab to load the recently loaded MIB files. The Recent section of the Load a MIB File dialog box is shown below.

 

 

Select the check box next to the MIB that is to be loaded and click Open to load the MIB file.

 

Note: The Load All MIBs option in the File menu loads all the recently loaded MIBs.

 

Let us have a detailed overview on the various options available in the MIB Settings section of the Load a MIB File dialog box.

 

MIB Loading Options

 

The various options available for loading MIBs are:

The following image depicts the Mib Settings tab in the Load MIB dialog box.

 

 

Load MIBs Directly

 

The MIB file is usually read and parsed into MIB modules and displayed in the MIB tree. In this case, when you load a MIB file, it is parsed and then loaded. This is time consuming because parsing is done every time a MIB file is loaded.

 

Load MIBs from Compiled Files

 

The next option is loading of the MIB files as compiled files. The main advantage here is that the loading time is reduced. This ultimately leads to the improvement in performance. To store the MIB information in a formatted structure, the following two new file types are made available.

When the option Load MIBs from Compiled File is selected, the MibBrowser loads the MIB from the cmi and cds files. If these files are not present, MibBrowser parses the MIB file, writes the output in the cmi and cds files, and loads the MIB file. For example, if you load the RFC1213-MIB, the MIB file is parsed and stored in the compiled MIB files as RFC1213-MIB.cmi and RFC1213-MIB.cds provided RFC1213-MIB is the module name of the RFC1213-MIB file.

 

When this MIB file is loaded again, the MIB is loaded from the cmi and cds files and no parsing is done. The advantage of using this option is, we need not parse the MIB each time we load, thus optimizing the load time and improving the performance. While loading the compiled MIBs, you need to load only the cmi file. The cmi file has a reference to the cds files. Therefore, the cds file need not be loaded directly.

 

Note: Any changes made to the MIB file after it has been loaded as a compiled MIB file are not reflected when it is loaded again. You have to remove the existing cmi and cds files and load the MIB again to view the latest changes. To overcome this, select the option" Overwrite existing Compiled MIB Files". If this option is set to true, the cmi and cds files are created each time the MIB is loaded. However, enabling this option is recommended only if you have changed the contents of the MIB file. Otherwise, this serves as a redundant option and increases the load time of the MIBs.

 

To convert the normal MIB files to the cmi and cds format, the MibToCMI utility can be used. This class is available in the <classes/com/adventnet/snmp/utils> directory. To use the utility, set the CLASSPATH to the classes directory and give the following command.

 

java com.adventnet.snmp.utils.MibToCMI directory name or file,another directory or file

 

The conversion can be done for individual files or for an entire directory of MIB files. If the utility is used across directories, the existing cmi and cds files should first be deleted from the directory.

 

Loading MIBs from a Database

 

The third option is loading of the MIB files from a database. The MIB files can be stored in any RDBMS such as MySQL or Oracle. Applications can load these MIB files directly from the database. This feature is particularly useful when the MIB files to be loaded are more in number.

 

The MibBrowser uses JDBC (Java Database Connectivity) for the database support. Applications should use a valid JDBC driver of the respective databases to enable the database support.

 

Selecting the option Load MIBs from Database enables the text fields in the JDBCParams section. On initializing the necessary database parameters in this section, the database support can be provided for loading MIBs. The required JDBCParams are as follows.

After selecting this loading option, select the required MIB file to be loaded from the Open tab of the Load a MIB File dialog box. If the selected MIB file is already present in the database, the MIB file is read, parsed, and loaded from the database. If the MIB file does not exist in the database, MibBrowser parses the MIB file, writes the output to the database, and then loads the MIB file.

 

Note: The recently loaded MIBs can be loaded automatically at startup by selecting the option, 'Load recently loaded Mibs at startup'.

 

Instructions for Using MySql Database for Loading MIBs

 

Having tested the loading of MIB files from the MySQL database, we understand that the following database parameters have to be configured in the application.

The jar file mysql_comp.jar has to be included in the CLASSPATH. If the jar is not in the CLASSPATH, the following exception is thrown.

 

Java.lang.ClassNotFoundException:org.gjt.mm.mysql.Driver>

 

Instructions for Using Oracle Database for Loading MIBs

 

The loading of MIB files from the Oracle database has also been tested. The following database parameters are to be configured in the application.

The oracle driver has to be included in the CLASSPATH. If the jar is not present in the CLASSPATH, the following exception is thrown.

 

Java.lang.ClassNotFoundException:oracle.jdbc.driver.OracleDriver

 

For other databases, use the equivalent parameters.

 

A few MIB files are provided in the mibs directory, i.e., RFC1213-MIB, RFC1271-RMON, RFC1155-SMI, RMON2-MIB, TOKEN-RING-RMON-MIB, and RFC1315-FRAME. It may be convenient to copy your MIB module files that are to be loaded into the "mibs" directory.

 

Note:

 

Apparently, MIBs are always parsed before loading when the following operations are performed.

  • Loading MIBs directly

  • Loading MIB from Compiled File for the first time

  • Selecting the "Overwrite existing compiled MIB files" option

  • Loading MIB from database for the first time



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.