camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Manero (JIRA)" <>
Subject [jira] [Created] (CAMEL-5251) camel-snmp component does correctly read SNMPv1 type PDUs from snmp4j
Date Mon, 07 May 2012 23:57:47 GMT
Ed Manero created CAMEL-5251:

             Summary: camel-snmp component does correctly read SNMPv1 type PDUs from snmp4j
                 Key: CAMEL-5251
             Project: Camel
          Issue Type: Bug
          Components: camel-snmp
    Affects Versions: 2.9.2
            Reporter: Ed Manero of the camel-snmp component inspects the PDU using getVariableBindings().
 This method does not contain any information for PDUs representing SNMPv1 messages. The javadoc
for org.snmp4j.PDUv1 indicates that unique accessors are provided for PDU instances of this
type.  Because of this needs to check if the PDU provided by snmp4j represents
an SNMPv1 message and if so use the special accessors to construct the message.

Here is a test case as posted from the user forum. Note that for SNMPv1 type messages the
body is empty (Body:<snmp></snmp>).

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:from uri="snmp://"/>
    <camel:to uri="log://foo?showAll=true"/>

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
CamelCreatedTimestamp=Wed May 02 10:28:25 WEST 2012},
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

[PTransportMapping_0.0.0.0/1162] foo                            INFO
CamelCreatedTimestamp=Wed May 02 11:33:49 WEST 2012},
Body:<snmp><entry><oid></oid><value>11 days,
here</value></entry></snmp>, Out: null]

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message