-------------------------------------------------------------------------------
- mib2opennms
-
- Author: Tomas Carlsson <tc@tompa.nu>
-
- http://tompa.nu/mib2opennms
-
- $Id: README 3400 2006-06-05 22:01:41Z brozow $
-------------------------------------------------------------------------------

This utility can read data from a collection of SNMP MIBs and output all the 
NOTIFICATION-TYPEs in OpenNMS eventconf.xml format.

It depends on libsmi (http://www.ibr.cs.tu-bs.de/projects/libsmi/),
packages libsmi2 and libsmi2-dev on Debian.


BUILD
-----
To compile run configure and make from the top level directory:

    $ ./configure
    $ make install

To change the default install location (/usr/local) add the "-­prefix=<path>"
argument when running configure.

RUNNING
-------

To run:
    $ mib2opennms -f outputfile -m <MIB path list> MIB1 MIB2 ...

for example:
    > mib2opennms -f myfile.xml -m ~/.snmp/mibs:/usr/share/snmp/mibs \
      CISCO-CCM-MIB CISCO-WIRELESS-IF-MIB

Note that the MIB path must include the paths where all mentioned MIBs
and their imported MIBs can be found.

The MIBs to convert can either be given as MIB module names or filenames, i.e
the following command is possible:

    > mib2opennms -f myfile.xml -m ~/.snmp/mibs:/usr/share/snmp/mibs \
      ~/.snmp/mibs/CISCO-*

and will convert all MIB files that starts with CISCO-.

The output file is not a complete xml file but only <event> entries that
can be pasted into eventconf.xml. The output looks like this:

<event>
 <mask>
  <maskelement>
   <mename>id</mename>
   <mevalue>.1.3.6.1.4.1.9.9.136.2.3.1</mevalue>
  </maskelement>
 </mask>
 <uei>http://uei.opennms.org/traps/cwrTrapThresh</uei>
 <event-label>cwrTrapThresh</event-label>
 <descr>

The radio subsystem generates this trap when a threshold crosses
its specified limit. The parameters identify the following
cwrThreshValue          - The value that was crossed.
cwrThreshHysteresisTime - The Hysteresis time that was specified.
cwrThreshLimitTime      - The Limit time that was specified.

   cwrThreshValue=%parm[1]%
   cwrThreshHysteresisTime=%parm[2]%
   cwrThreshLimitTime=%parm[3]%
 </descr>
 <logmsg dest='logndisplay'>
cwrTrapThresh trap received
 </logmsg>
 <severity>Indeterminate</severity>
</event>

SOME NOTES (added by Tarus):
----------------------------

If mib2opennms complains about a missing MIB, be sure that there is a file
in your "-m" MIB path that has the *exact* name as the MIB it is complaining
about.

For example, if it complains "Can't find RFC-1213" and you have a file in
your path called "RFC1213", you must rename it or copy it to "RFC-1213".

The extensions .txt, .my and I believe .mib are acceptable, so in the
above example, RFC-1213.txt should work.

Also, the <mevalue> for generic should almost always be "6", although
mib2opennms usually sets it to "0".

