Troubleshooting MIB compilation errors

The following section lists a few of the MIB file compilation errors and how to resolve them:

Unknown variable 'xxxxxxxxxxxx' in OID object

Issue

The MIB file compilation fails and may display unknown variable error.

Probable causes

Following are a few probable reasons causing this error:

Cause 1: 

The variable used is defined differently. For example, the following error indicates that the definition for trapGeneralComment is missing in the MIB file. The definition is missing because trapGeneralComment is defined as trapGenericTrapComment in the file. 

13:55:25 MC::Base:167 Major -- Error at
C :\PROGRA~1\BMCSOF~1\Impact\server\bin\mib2map.pl:149
(MA::SnmpTranslator::MakeAdapterData):
Unknown variable 'trapGeneralComment' in oid object '1.3.6.1.4.1.3167.1.13.7.0.13012'


####################Object definition######################
trapGenericTrapComment OBJECT-TYPE
SYNTAX  DisplayString
ACCESS  not-accessible
STATUS  mandatory
DESCRIPTION
"GenericTrapComment"
::={ trapsInfo 116 }

Resolution

To correct this issue, update all occurrences of the undefined variable to reference the defined variable. For example, change trapGeneralComment to trapGenericTrapComment.

Cause 2: 

Letter case mismatch. In this example, the variable is defined as trapClsErrorCode but referred as trapClsErrorcode. The letter c in code is defined in the upper case but referred as lower case.

13:55:24 MC::Base:167 Major - Error at  C:\PROGRA~1\BMCSOF~1\Impact\server/lib/perl/MA/SnmpTranslator.pm:469  (MA::SnmpTranslator::MakeBarocVar):
Unknown variable 'trapClsErrorcode' in oid object '1.3.6.1.4.1.3167.1.2.5.0.1021'

####################Object definition######################
trapClsErrorCode OBJECT-TYPE
SYNTAX DisplayString
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"CLS error code"
::={ trapsInfo 124 }


Resolution

To correct this issue, refer to the object type exactly as it is defined.

Cannot find module (xxxxxxxxxx)

Issue

The MIB file compilation fails due to the missing file or module. An example error message is shown below:

Cannot find module (NETWORK-APPLIANCE-MIB): At line 26 in E:\BMC_Software\MasterCell\server\SNMPAdapter\ucd-snmp-4.2.3\usr\mibs/netapp_dfm.mib.txt

Probable cause

This error may occur due to missing file or module. For example, the following error indicates that the netapp_dfm.mib file is trying to import a definition from {{NETWORK-APPLIANCE-MIB,}}, but the MIB file is not present in the directory of files that you are compiling.

Resolution

To correct this issue, locate the missing MIB file and include it with the MIB files that are being compiled.

Unable to find a matching object identifier for "a"

The MIB file compilation fails due to the missing dependent MIB files. 

Probable cause

The MIB files depend on standard MIB files. This issue is caused when some of the dependent MIBs are not included while compiling.
This can occur when the user has not specified the location of the default MIBs. 

Resolution

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.

MIB compilation fails due to manual editing of the mcsnmptrapd.map file

Issue

The MIB file compilation fails and may display the following error message:

SAX Parse Exception occurred the element type class must be terminated by the matching end-tag

Probable cause

This error occurs if the mcsnmptrapd.map is manually edited and comments have been inserted within a mapping.

Resolution

To correct this issue, move comments either before or after the mapping in the mcsnmptrapd.map file.

Too many textual conventions (INTEGER): At line nn in xxxxxxxxxxxxxxxxxxx.my

Issue

The MIB file compilation fails and may display the following error message:

Too many textual conventions (INTEGER): At line nn in xxxxxxxxxxxxxxxxxxx.my

Probable cause

Snmptranslate has a limit of 256 object imports. If you try to import a MIB file that in turn imports more than 256 objects, the MIB compilation fails.

Resolution

To correct this issue, contact BMC Customer Support.

MIB compilation fails due to unlinked or undefined object identifier

Issue

MIB compilation fails due to unlinked or undefined object identifier.

Probable cause

The error is caused due an unlinked or undefined object identifier. In the following example, the printer-mib MIB file references mib-2, which is not defined in the MIB or imported from another MIB.

Unlinked OID in Printer-MIB: printmib ::= { mib-2 43 }
 
Undefined identifier: mib-2 near line 10 of D:\vendormibs/Printer-MIB.mib

Resolution

To correct the issue, locate the missing definition and add a line to import the missing MIB. For example, the mib-2 definition is found in RFC1213-MIB. Add a line in the printer-mib file to import mib-2 from RFC1213-MIB.

Did not find 'xxxxxxxx' in module

Issue

MIB compilation fails due to missing object definition. 

Probable cause

This error may occur when a MIB file is trying to import a definition from another MIB file that does not contain the definition. An example error message is as shown below:

Did not find 'Boolean' in module HOST-RESOURCES-MIB (D:\vendormibs/CLIENT-MIB.mib)

Following is an example of the Import section from CLIENT-MIB. In this instance, Boolean is not defined in HOST-RESOURCES-MIB.

IMPORTS
TimeTicks, Counter, enterprises FROM RFC1155-SMI
OBJECT-TYPE&  FROM RFC-1212
DisplayString FROM RFC1213-MIB
Boolean FROM HOST-RESOURCES-MIB
KBytes FROM HOST-RESOURCES-MIB
DateAndTime   FROM HOST-RESOURCES-MIB
InternationalDisplayString  FROM HOST-RESOURCES-MIB
ProductID  FROM HOST-RESOURCES-MIB ;

Resolution

To correct the issue, , locate the MIB that has the missing definition and add it to the import section of the affected MIB.

Common MIB compilation errors

MIB compilation may fail due to a few common reasons as listed in the following section:

Common compilation errors

Issue

SEQUENCE construct

Probable cause

The compilation may fail if the SEQUENCE construct is used in the MIB files.

Resolution
Edit the MIB files to remove the SEQUENCE construct.

Issue

Object Id is not unique

Probable cause

The compilation may fail if the object identifiers used in MIB files are not unique.

Resolution
Ensure that object identifiers used in the MIB files are unique.

Issue

Unresolved OID

Probable cause

While compiling some MIBs, the compiler is unable to resolve the object identifier (OID) of an MIB node. The referenced MIB node is not imported from the MIB that defines that node.

Resolution
Determine the MIB where the unresolved MIB node is defined. Include a line in the IMPORTS statement of the faulty MIB to import the MIB node from the original MIB. Alternatively, identify the OID value of the reference node in the original MIB, and edit the faulty MIB with the absolute OID value in place of the name of the unresolved MIB node.

Issue

Multiple MIB definitions in a single MIB file

Probable cause
Some MIBs that include multiple MIB definitions in a single file. The compiler tool cannot compile these MIBs successfully.

Resolution
Copy each of the MIB definitions from the original MIB file into individual files. Compile each of the MIB files according to the dependency sequence.

Issue

Syntax error, EXTREME-SYSTEM-MIB--error message

Probable cause
If a single file has many MIB definitions. The compiler cannot compile MIBs with multiple MIB definitions in a single file.

Resolution
Copy the MIB definitions into individual files. Save these files to a directory that contains the vendor-specific MIB files and compile all of them to get a consolidated output.

Each MIB definition has the following general format:

mibname DEFINITIONS ::= BEGIN  
.....
.....
statements
....
END

Issue

Duplicate MIB compilation

Probable causes

  • You are trying to compile an MIB that has already been compiled. As a part of the compiler tool, standard RFC MIBs -- RFC1155, RFC1213, SNMPv2-SMI, SNMPv2-CONF, and SNMPv2-TC -- are precompiled and loaded into memory during compilation of each MIB. You do not need to recompile or overwrite these precompiled MIBs.
  • If one or more of the above MIBs are included when compiling a MIB, the MIB that you are trying to compile is incorrect.
  • The nodes from the above precompiled MIBs were incorrectly imported.
  • If a duplicate MIB compilation error occurs during incremental compilation of any MIB, it indicates the existence of some wrong import statements in the MIB files that were previously compiled.

Resolution

Ensure that you retrieve the MIBs that you compile from the correct sources. You must import MIB nodes from the MIB in which they were originally defined. Modify the faulty MIB to import MIB nodes from the correct MIB file.

Issue

Syntax error--no declaration

Probable cause
During compilation of MIB ADMIN-AUTH-STATS-MIB, the compilation fails with a syntax error. The error is due to the use of MAX, which has no declaration anywhere in the MIB or in the dependent MIBs.

Resolution
Substitute the actual maximum integer value in place of MAX.

Issue

Syntax error--no definition

Probable cause
During compilation of CISCO-TC MIB, the compiler fails with a syntax error. The SMI is used to define the Unsigned32 textual convention.

Resolution
Remove the SMI statement and define the Unsigned32 textual convention.

Was this page helpful? Yes No Submitting... Thank you

Comments