Using the mib2map CLI utility
This topic explains the concept of compiling MIB files using the mib2map CLI utility. This topic also provides instructions for compiling the MIB files using the utility.
The mib2map CLI utility is bundled with cell component (server and remote) and is located in the following directory:
- (Microsoft Windows) <TrueSight Infrastructure Management Install Directory>\pw\server\bin
- (Linux) <TrueSight Infrastructure Management Install Directory>/pw/server/bin
Before you begin
- Ensure that the following components are installed on the host computer on which you plan to run the mib2map command:
- Perl
- Net-SNMP Library. For details, see http://www.net-snmp.org/
- You may have to edit the MIB files to avoid syntax errors while compiling. For details, see Troubleshooting-MIB-compilation-errors.
- Ensure that all the dependent MIB files are present in the same directory as the main input MIB file. For example, if mib A imports from mib B, then place mib B in the same directory as mib A.
To compile MIB files
Copy the out-of-the-box (net-snmp reference MIBs) and vendor MIB files to a temporary directory.
Go to the <TrueSight Infrastructure Management Install Directory>\pw\server\bin directory, and run the mib2map command to compile the MIB files as shown in the following example:
#Syntax - Microsoft Windows
#Separate the MIB file locations using a semicolon.
perl mib2map.pl -s <Path to snmptranslate.exe> -m ALL -M "<path to net-snmp MIBs>;<path to your MIB directory>"
#Example
perl mib2map.pl -s "C:\usr\bin\snmptranslate.exe" -m ALL -M "D:\tmp\vendormibs;C:\usr\share\snmp\mibs" > mib2map.out 2>&1
#Syntax - Linux
#Separate the MIB file locations using a colon.
mib2map.pl -s <Path to snmptranslate> -m ALL -M "<path to net-snmp MIBs>:<path to your MIB directory>"
#TBD Linux example
perl /opt/bmc/TSIMAgent/pw/server/bin/mib2map.pl -s /usr/bin/snmptranslate -m ALL -M /usr/share/snmp/mibs:/opt/sacm/netscoutIf the mib2map command runs successfully, it creates the following output files in the <TrueSight Infrastructure Management Install Directory>\pw\server\bin directory.
- mcsnmptrapdmib.baroc: This file contains the BAROC class definitions of the SNMP Traps found.
- mcsnmptrapdmibe.baroc: This file contains the BAROC enumerations of the MIB enumerated variables that are sent by traps.
- mcsnmptrapdmib.dat: This file contains information about object identifiers (OIDs), symbolic names, enumerations and indexes found in MIB traps.
- mcsnmptrapdmib.map: The adapter uses this mapping file to convert traps into events in the BAROC format.
- Take a backup of the existing mcsnmptrapdmib.baroc and mcsnmptrapdmibe.baroc files in the kb\classes directory. Replace the newly created output baroc files into the kb\classes directory.
Go to the <TrueSight Infrastructure Management Install Directory>\pw\server\etc\CellName\kb\classes directory, open the .load file and update the following file entries in the sequence as shown in the following example:
mcsnmptrapdmibe
mcsnmptrapdmibNote: Ensure that the .load file does not have the duplicate entries of these baroc files.
Rename the mcsnmptrapdmib.dat and mcsnmptrapdmib.map files to mcsnmptrapd.dat and mcsnmptrapd.map respectively, and copy the renamed files to the <TrueSight Infrastructure Management Install Directory>\pw\server\etc directory.
- Compile the KB. For details, see mccomp.
- Restart the cell and Event Adapter. For details, see Starting-and-stopping-the-BMC-Event-Adapters.
To edit the MAP file
Do the following to manually edit the map file:
- Go to the <TrueSight Infrastructure Management Install Directory>\pw\server\etc directory.
- Before editing, take a back up of the mcsnmptrapd.map file.
- Open the mcsnmptrapd.map file using a text editor.
You can add, edit, or remove the variables in the mcsnmptrapd.map file. The following section lists a few of the variables and an example class file:
- msg
- mc_tool_class
- mc_tool
- mc_host_address
- mc_location
- severity
The values for this variable are UNKNOWN, OK, INFO, WARNING, MINOR, MAJOR, CRITICAL, and DOWN. - mc_priority
The values for this variable are PRIORITY_5, PRIORITY_4, PRIORITY_3, PRIORITY_2, and PRIORITY_1. - mc_notes
- Compile the KB. For details, see mccomp.
- Restart the cell and Event Adapter. For details, see Starting-and-stopping-the-BMC-Event-Adapters.