Mibs and Varbinds
Subscribe

From OpenNMS

Jump to: navigation, search
⚠
This page is obsolete. Please see Trap Configuration How-To instead.

Adding masks that filter on varbinds is documented on the SNMP trap configuration page.

You've converted your MIBs to the OpenNMS XML format, but still you get events like this shown in the first screenshot.

Notice 2303: Normal trap from xxxxxxx at Wednesday, June 17, 2009 4:06:58 PM CEST:
UEI uei.opennms.org/generic/traps/EnterpriseDefault
<p>
This is the default event format used when an enterprise specific event (trap)
is received for which no format has been configured (i.e. no event definition
exists).
</p>
<p>The total number of arguments received with the trap: 5.</p>
<p>They were:<p> 
<p>
.1.3.6.1.4.1.6486.800.1.3.2.4.2.13="66"
.1.3.6.1.4.1.6486.800.1.3.2.4.2.9="4"
.1.3.6.1.4.1.6486.800.1.3.2.4.2.10="3"
.1.3.6.1.4.1.6486.800.1.3.2.4.2.11="18"
.1.3.6.1.4.1.6486.800.1.3.2.4.2.12="Fan is inoperable"
</p>
<p>Here is a "mask" element definition that matches this event, for use in event configuration files:<br/>
<blockquote>
<mask><br/>
  <maskelement><br/>
    <mename>id</mename><br/>
    <mevalue>.1.3.6.1.4.1.6486.800.1.3.2.4.1</mevalue><br/>
  </maskelement><br/>
  <maskelement><br/>
    <mename>generic</mename><br/>
    <mevalue>6</mevalue><br/>
  </maskelement><br/>
  <maskelement><br/>
    <mename>specific</mename><br/>
    <mevalue>2</mevalue><br/>
  </maskelement><br/>
</mask>
</blockquote>
</p>

How to fix that

This text is copied from a Mail from AndyMillett.

The XML output has been modified to encompass each variable in the 'chassisTrapsAlert' so that it includes the additional varbinds to format the output correctly.

For example, the generic chassisTrapsAlert looks like the following:

<maskelement>
  <mename>id</mename>
  <mevalue>.1.3.6.1.4.1.6486.800.1.3.2.4.1</mevalue>
</maskelement>

Without varbinds specified you will get an unformatted enterprise event as OpenNMS doesn't know how to interrogate all of the variables sent.

Screenshot1

With a varbind set, like so (chassisTrapAlertcertifyCompleted as an example):

<varbind>
  <vbnumber>4</vbnumber>
  <vbvalue>5</vbvalue>
</varbind>

And the generic chassisTrapsAlert modified to 'chassisTrapsAlertcertifyCompleted' (basically a copy of the original trap event xml amended with the varbind (above) and additional text).

<uei>uei.opennms.org/mib2opennms/chassisTrapsAlertcertifyCompleted</uei>

You then get:

Screenshot2

The Chassis MIB contains 57 variables which come under the chassisTrapsAlert. Therefore, you would need 57 copies of the base chassisTrapsAlert with each varbind specified. Or, just specify the trap/event you are interested in and ignore the rest.