[opennms-devel] Imported SNMP-Trap MIB is ignored

Ronny Trommer <[email protected]> Thu, 12 Feb 2009 14:42:08 +0100
Newsgroups gmane.network.opennms.bugs,gmane.network.opennms.devel
Message-ID <[email protected]>
Hi at all,

i have a device which sends traps to OpenNMS, i receive the  
unformatted EnterpriseDefault-Traps. OpenNMS proposes to create Event  
with following definition:

	<mask>
	  <maskelement>
	    <mename>id</mename>
	    <mevalue>.1.3.6.1.4.1.14848</mevalue>
	  </maskelement>
	  <maskelement>
	    <mename>generic</mename>
	    <mevalue>6</mevalue>
	  </maskelement>
	  <maskelement>
	    <mename>specific</mename>
	    <mevalue>101</mevalue>
	  </maskelement>
	</mask>

I downloaded the MIB from the manufacturer and i create a events-file  
with mib2opennms (options -6 -w). The generated event is shown below.  
I added the new event.xml file in /etc/opennms/eventconf.xml as <event- 
file>

<events>
.
<!-- some other events with other OIDs -->
.
.
	<event>
	  <mask>
	    <maskelement>
	      <mename>id</mename>
	      <mevalue>.1.3.6.1.4.1.14848</mevalue>
	     </maskelement>
	     <maskelement>
	       <mename>generic</mename>
	       <mevalue>6</mevalue>
	     </maskelement>
	     <maskelement>
	       <mename>specific</mename>
	       <mevalue>101</mevalue>
	     </maskelement>
	  </mask>
	  <uei>uei.opennms.org/mib2opennms/ 
ethernetboxNotificationConfigSaved</uei>
	  <event-label>BETTER-NETWORKS-ETHERNETBOX-MIB defined trap event:  
ethernetboxNotificationConfigSaved</event-label>
	  <descr>
	    &lt;p&gt;Event sent when Ethernet Box Configuration is written in  
flash memory&lt;/p&gt;&lt;table&gt;
	    &lt;tr&gt;&lt;td&gt;&lt;b&gt;

	    uptime&lt;/b&gt;&lt;/td&gt;&lt;td&gt;
	    %parm[#1]%;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/ 
td&gt;&lt;/tr&gt;
	    &lt;tr&gt;&lt;td&gt;&lt;b&gt;

	    location&lt;/b&gt;&lt;/td&gt;&lt;td&gt;
	    %parm[#2]%;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/ 
td&gt;&lt;/tr&gt;
	    &lt;tr&gt;&lt;td&gt;&lt;b&gt;

	    address&lt;/b&gt;&lt;/td&gt;&lt;td&gt;
	    %parm[#3]%;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/ 
td&gt;&lt;/tr&gt;&lt;/table&gt;
	  </descr>
	  <logmsg dest='logndisplay'>&lt;p&gt;
		ethernetboxNotificationConfigSaved trap received
		uptime=%parm[#1]%
		location=%parm[#2]%
		address=%parm[#3]%&lt;/p&gt;
	  </logmsg>
	  <severity>Minor</severity>
	</event>

Btw:
This trap will be send, if I save the configuration of ethernet  
sensorbox. After every save the Etherbox sends this event,
so i can easy trial an error the OpenNMS configuration. The device can  
only SNMP V1 so i added in

	"Admin --> Configure SNMP Community Names by IP"

a special V1 community.

Additionaly i have create tcpdump from the snmp-trap and opened with  
wireshark see here:



A debug on trapd.log shows the following:

	2009-02-12 14:05:20,713 DEBUG [TrapQueueProcessor] Snmp4JTrapNotifier 
$Snmp4JV1TrapInformation: v1 trap - trapInterface: /9.2.2.90
	2009-02-12 14:05:20,713 DEBUG [TrapQueueProcessor] EventCreator: snmp  
trap [Generic=6, Specific=101, EnterpriseId=.1.3.6.1.4.1.14848]
	2009-02-12 14:05:20,732 DEBUG [TrapQueueProcessor] EventConfData:  
Match found using key: EventKey
	[
         	generic    = [6]
	]

	2009-02-12 14:05:20,732 DEBUG [TrapQueueProcessor]  
TrapQueueProcessor: Trap successfully converted and sent to eventd  
with UEI 	
	uei.opennms.org/generic/traps/EnterpriseDefault

So i don“t know why OpenNMS shows always an EnterpriseDefault-Event.

My environment:
	Linux:		Debian 4.0
	Kernel:		2.6.22-4-686-bigmem
	OpenNMS:	1.6.2
	Java:		java version "1.6.0_06"
				Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
				Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

	
Anyone some ideas? Thx in advance

--
Ronny Trommer (Germany)
Web: http://www.open-factory.org
IRC: irc.freenode.org - #opennms

PGP key: 7ED9 1A00 0BD9 EB84 9F63  5808 B1BC E829 E383 98A0
Keyserver: keyserver.pgp.com

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
PGP.sig (application/pgp-signature, 194 B) - not displayed