Overcoming Errors when Compiling MIBs in MOM 2005 (via smi2smir.exe)
Overcoming Errors when Compiling MIBs in MOM 2005 (via smi2smir.exe)
This post is for MOM administrators using MOM as an SNMP Trap-catcher, as defined in http://support.microsoft.com/kb/555455
In this post, I am going to offer some insight into addressing a common issue when compiling MIBs into WMI (MOF) format for MOM 2005 when using MOM as an SNMP trap-catcher, and offer a couple examples of an alternative that allows one to skip this process altogether.
Plan A – Identifying and Addressing Dependencies for MIB compilation to MOF Format
Windows has its own "SNMP" space in WMI, and by converting MIBs to MOF and loading into the WMI namespace (\.\root\snmp\smir ) puts them in a format MOM can understand. It's not uncommon when compiling MIBs to WMI format (MOF) with the smi2smir utility, you may run into an error, which is often assumed to be a syntax error. (Cisco seems to be a common source of problems). This is actually not always the case. It's sometimes a matter of identifying the MIBs upon which a given MIB is dependent. Consider the following example:
All vendors have the own SNMP OID (for example VMWARE is OID 1.3.6.1.4.1.687 or iso.org.dod.internet.private.enterprises.vmware). To successfully compile VMWARE MIB ( VMWARE-SYSTEM-MIB.mib) to MOF - I need to add all MIBs on which this one is dependent (up to SNMP hierarchy - iso.org.dod.internet.private.enterprises ) in my smi2smir statement in order to compile successfully.
To identify the dependencies of a given MIB, you need to examine the IMPORTS section of the header file of the MIB you wish to import. For example, see head of VMWARE-SYSTEM-MIB:
--------begin VMWARE-SYSTEM-MIB: file-------
VMWARE-SYSTEM-MIB DEFINITIONS ::= BEGIN IMPORTS DisplayString vmwSystem -- OBJECT IDENTIFIER ::= { vmware 1 } --------end VMWARE-SYSTEM-MIB: file------- In this example, the smi2smir utility reads ahead to retrieve objects FROM RFC1155-SMI, RFC1213-MIB, and VMWARE-ROOT-MIB. So if you do not first compile the MIBS on which this one is dependent, you'll receive an error message. You can compile these one at a time in order, or simply address all in a single command with smi2smir.exe, as shown in the example below. EXAMPLE smi2smir.exe /g VMWARE-SYSTEM-MIB.mib RFC1155-SMI.mib RFC1213-MIB.mib VMWARE-ROOT-MIB.mib IANAifType-MIB-V1SMI.my > VMWARE-SYSTEM-MIB.MOF
C:\WINDOWS\system32\wbem\snmp>smi2smir.exe /g OLD-CISCO-CPU-MIB.mib RFC-1212.mib CISCO-SMI-V1SMI.mib SNMPv2-SMI-V1SMI.mib > OLD-CISCO-CPU.MOF
Option B – Custom MOM Scripts If you do get your MIB loaded, the data displayed in the MOM alert window is simply a data dump of the varbind (*variable binding) list, which is a REALLY ugly and hard to work with. The other option is to not bother with importing the MIB at all. With MOM, you can simply write a script to parse the raw SNMP data to create a separate well-formatted event in MOM. I could spend an entire book chapter on this topic, so I'll simply point to a couple good examples of this you can read on your own:
Parsing UPS SNMP Events by John Hann http://msmvps.com/blogs/jfhann/pages/69388.aspx
And this 2nd one is a bit long, but I do step through the process of parsing an event parameter to transform
Parsing Nortel SNMP Events by Pete Zerger http://www.it-jedi.net/2006/12/day-6-telecom-monitoring-with-snmp-and_365.html
*DEFINITION: Variable Binding is a list of MIB objects that allows a requests recipient to see what the host issuing the SNMP GET wants to know
Thanks to Serhiy Lysan, sales specialist for Juniper Networks in the Ukraine for his input on this post.
Labels: Extending MOM, Scripts, SNMP |










Comments on "Overcoming Errors when Compiling MIBs in MOM 2005 (via smi2smir.exe)"
post a comment links to this post