camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: SNMP traps - missing information in the Camel message?
Date Wed, 02 May 2012 12:40:39 GMT

Welcome on the ride.

I suggest If you can then dive into the source code of camel-snmp and
see if there is something wrong / problem.
Camel uses a 3rd party framework for the SNMP (snmp4j), so it may also
be a issue with that, or a configuration issue etc.

You may also try to upgrade to a newer release of snmp4j. In fact I
can see there is a newer release so we should work on that upgrade at

On Wed, May 2, 2012 at 12:53 PM, Jonathan Barber
<> wrote:
> Hi, I'm evaluating Camel for aggregating and processing events  - and
> it looks like the EIP facilities and components that Camel provide
> would make my task relatively easy, and I'm really excited about the
> possibilities Camel offers. Thanks for creating it!
> I'm starting to create some simple use cases with Camel and SNMP
> traps, and I'm running into some issues (this might just be because I
> don't understand properly what's going on). My current problem is that
> when I create a route for SNMP traps and send SNMP v1 traps to it,
> Camel seems to lose information from the trap such as the originating
> IP address of the trap.
> Here's what I'm doing: I first generate my camel project with the maven command:
> mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes
> -DarchetypeArtifactId=camel-archetype-spring -DarchetypeVersion=2.9.2
> -DgroupId=camel-snmp-test -DartifactId=camel-snmp-test
> And modify the camel-context.xml file to contain the route:
> <camel:route>
>    <camel:from uri="snmp://"/>
>    <camel:to uri="log://foo?showAll=true"/>
> </camel:route>
> then run the project with:
> mvn camel:run
> I then generate a trap with the net-snmp command snmptrap and the syntax:
> snmptrap -v 1 -c public
> SNMPv2-MIB::authenticationFailure 0 coldStart.0 10
> This gives me a log message of:
> [PTransportMapping_0.0.0.0/1162] foo                            INFO
> Exchange[Id:ID-addict-33083-1335950429878-0-18,
> ExchangePattern:InOnly,
> Properties:{CamelToEndpoint=log://foo?showAll=true,
> CamelCreatedTimestamp=Wed May 02 10:28:25 WEST 2012},
> Headers:{breadcrumbId=ID-addict--33083-1335950429878-0-17},
> BodyType:String, Body:<snmp></snmp>, Out: null]
> I'd expect to see the enterprise-oid
> (SNMPv2-MIB::authenticationFailure), agent (, trap-type (0),
> specific-type (coldStart.0), and uptime (10 seconds), it would be nice
> to see the IP that the PDU came from as well because not all traps
> include a useful agent address.
> Interestingly, with SNMP v2 traps I get some of this information in
> the body (although no sender IP address):
> snmptrap -v 2c -c public localhost:1162 ''
> SNMPv2-MIB::authenticationFailure SNMPv2-MIB::sysLocation.0 s "just
> here"
> [PTransportMapping_0.0.0.0/1162] foo                            INFO
> Exchange[Id:ID-addict-33083-1335950429878-0-20,
> ExchangePattern:InOnly,
> Properties:{CamelToEndpoint=log://foo?showAll=true,
> CamelCreatedTimestamp=Wed May 02 11:33:49 WEST 2012},
> Headers:{breadcrumbId=ID-addict-33083-1335950429878-0-19},
> BodyType:String,
> Body:<snmp><entry><oid></oid><value>11
> 23:15:58.58</value></entry><entry><oid></oid><value></value></entry><entry><oid></oid><value>just
> here</value></entry></snmp>, Out: null]
> so do I need to do something more to get the SNMPv1 information and
> sender IP address, or does the SNMP component not encode this
> information into the message? Do other components include information
> about the remote host, or is this usually excluded?
> Regards
> --
> Jonathan Barber <>

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message