You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jonathan Barber <jo...@gmail.com> on 2012/05/02 12:53:48 UTC
SNMP traps - missing information in the Camel message?
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://0.0.0.0:1162?type=TRAP"/>
<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 127.0.0.1:1162
SNMPv2-MIB::authenticationFailure 1.2.3.4 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 (1.2.3.4), 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>1.3.6.1.2.1.1.3.0</oid><value>11 days,
23:15:58.58</value></entry><entry><oid>1.3.6.1.6.3.1.1.4.1.0</oid><value>1.3.6.1.6.3.1.1.5.5</value></entry><entry><oid>1.3.6.1.2.1.1.6.0</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 <jo...@gmail.com>
RE: SNMP traps - missing information in the Camel message?
Posted by Ed Manero <em...@xmatters.com>.
Hi Jonathan,
I like your implementation and yes my original implementation overlooks that v1 messages may have variables bindings. I think your patch should be applied as the fix.
Regards,
Ed
________________________________________
From: Jonathan Barber [jonathan.barber@gmail.com]
Sent: May 8, 2012 4:57 PM
To: users@camel.apache.org
Subject: Re: SNMP traps - missing information in the Camel message?
On 8 May 2012 01:07, Ed Manero <em...@xmatters.com> wrote:
> Hi Jonathan/Claus,
>
> It looks like there is a deficiency in camel-snmp. SnmpConverters.java only uses org.snmp4j.PDU.getVariableBindings() to construct a camel message based on snmp traps received by the component. However this is only supported for v2c and v3 type messages. Version 1 messages are represented by a subclass org.snmp4j.PDUv1 which as unique accessors for obtaining the information you are looking for.
>
I just finished duplicating your work before I checked my email to see
you had done it!
I submitted my patch (against Camel 2.10.0) under CAMEL-5255.
> I have opened CAMEL-5251 for this issue and attached a modified SnmpConverters.java which creates version 1 messages that look like this:
>
> <snmp><entry><agentaddress>1.2.3.4</agentaddress></entry><entry><enterpriseoid>1.3.6.1.6.3.1.1.5.5</enterpriseoid></entry><entry><generictrapid>0</generictrapid></entry><entry><specifictrapid>0</specifictrapid></entry><entry><sysuptime>10</sysuptime></entry></snmp>
This is a better idea than I had - for some reason I pretended the
sequence names were oids. So I've stolen your layout and reattached my
updated patch.
I've also included the attribute Claus suggested to make it easier to
know that the extra information is available (although I've set the
messageType to v1 because I don't think there's such as thing as SNMP
v1c).
>
> I work with snmp messages very often and I am also new to camel so please feel free to correct any mistakes I may have made either in the usefulness of the snmp message I constructed or the manner of implementation within the camel-snmp module.
I think SNMPv1 traps contain variable bindings as well, and I don't
think your patch handles this?
> Regards,
> Ed
--
Jonathan Barber <jo...@gmail.com>
Re: SNMP traps - missing information in the Camel message?
Posted by Jonathan Barber <jo...@gmail.com>.
On 8 May 2012 01:07, Ed Manero <em...@xmatters.com> wrote:
> Hi Jonathan/Claus,
>
> It looks like there is a deficiency in camel-snmp. SnmpConverters.java only uses org.snmp4j.PDU.getVariableBindings() to construct a camel message based on snmp traps received by the component. However this is only supported for v2c and v3 type messages. Version 1 messages are represented by a subclass org.snmp4j.PDUv1 which as unique accessors for obtaining the information you are looking for.
>
I just finished duplicating your work before I checked my email to see
you had done it!
I submitted my patch (against Camel 2.10.0) under CAMEL-5255.
> I have opened CAMEL-5251 for this issue and attached a modified SnmpConverters.java which creates version 1 messages that look like this:
>
> <snmp><entry><agentaddress>1.2.3.4</agentaddress></entry><entry><enterpriseoid>1.3.6.1.6.3.1.1.5.5</enterpriseoid></entry><entry><generictrapid>0</generictrapid></entry><entry><specifictrapid>0</specifictrapid></entry><entry><sysuptime>10</sysuptime></entry></snmp>
This is a better idea than I had - for some reason I pretended the
sequence names were oids. So I've stolen your layout and reattached my
updated patch.
I've also included the attribute Claus suggested to make it easier to
know that the extra information is available (although I've set the
messageType to v1 because I don't think there's such as thing as SNMP
v1c).
>
> I work with snmp messages very often and I am also new to camel so please feel free to correct any mistakes I may have made either in the usefulness of the snmp message I constructed or the manner of implementation within the camel-snmp module.
I think SNMPv1 traps contain variable bindings as well, and I don't
think your patch handles this?
> Regards,
> Ed
--
Jonathan Barber <jo...@gmail.com>
Re: SNMP traps - missing information in the Camel message?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Thanks for the patch.
I wonder if we should add an attribute in the XML output of camel-snmp
to include what type the message is (eg as you say there is some
differences between them.)
Eg something alike:
<snmp messageType="v1c">
...
</snmp>
If that is possible to determine and include.
And yes most people dont work with SNMP on a daily basis.
Its been a while since I traced packets in wireshark to figure out why
my alerts didn't work.
On Tue, May 8, 2012 at 2:09 AM, Ed Manero <em...@xmatters.com> wrote:
> Correction to my original email. I meant to write that I do NOT work with snmp message very often.
>
> Ed
>
> -----Original Message-----
> From: Ed Manero [mailto:emanero@xmatters.com]
> Sent: Monday, May 07, 2012 5:07 PM
> To: users@camel.apache.org
> Subject: RE: SNMP traps - missing information in the Camel message?
>
> Hi Jonathan/Claus,
>
> It looks like there is a deficiency in camel-snmp. SnmpConverters.java only uses org.snmp4j.PDU.getVariableBindings() to construct a camel message based on snmp traps received by the component. However this is only supported for v2c and v3 type messages. Version 1 messages are represented by a subclass org.snmp4j.PDUv1 which as unique accessors for obtaining the information you are looking for.
>
> I have opened CAMEL-5251 for this issue and attached a modified SnmpConverters.java which creates version 1 messages that look like this:
>
> <snmp><entry><agentaddress>1.2.3.4</agentaddress></entry><entry><enterpriseoid>1.3.6.1.6.3.1.1.5.5</enterpriseoid></entry><entry><generictrapid>0</generictrapid></entry><entry><specifictrapid>0</specifictrapid></entry><entry><sysuptime>10</sysuptime></entry></snmp>
>
> I work with snmp messages very often and I am also new to camel so please feel free to correct any mistakes I may have made either in the usefulness of the snmp message I constructed or the manner of implementation within the camel-snmp module.
>
> Regards,
> Ed
> ________________________________________
> From: Claus Ibsen [claus.ibsen@gmail.com]
> Sent: May 2, 2012 5:40 AM
> To: users@camel.apache.org
> Subject: Re: SNMP traps - missing information in the Camel message?
>
> Hi
>
> 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 Camel.
>
>
> On Wed, May 2, 2012 at 12:53 PM, Jonathan Barber <jo...@gmail.com> 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://0.0.0.0:1162?type=TRAP"/>
>> <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 127.0.0.1:1162
>> SNMPv2-MIB::authenticationFailure 1.2.3.4 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 (1.2.3.4), 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>1.3.6.1.2.1.1.3.0</oid><value>11 days,
>> 23:15:58.58</value></entry><entry><oid>1.3.6.1.6.3.1.1.4.1.0</oid><val
>> ue>1.3.6.1.6.3.1.1.5.5</value></entry><entry><oid>1.3.6.1.2.1.1.6.0</o
>> id><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 <jo...@gmail.com>
>
>
>
> --
> Claus Ibsen
> -----------------
> CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
RE: SNMP traps - missing information in the Camel message?
Posted by Ed Manero <em...@xmatters.com>.
Correction to my original email. I meant to write that I do NOT work with snmp message very often.
Ed
-----Original Message-----
From: Ed Manero [mailto:emanero@xmatters.com]
Sent: Monday, May 07, 2012 5:07 PM
To: users@camel.apache.org
Subject: RE: SNMP traps - missing information in the Camel message?
Hi Jonathan/Claus,
It looks like there is a deficiency in camel-snmp. SnmpConverters.java only uses org.snmp4j.PDU.getVariableBindings() to construct a camel message based on snmp traps received by the component. However this is only supported for v2c and v3 type messages. Version 1 messages are represented by a subclass org.snmp4j.PDUv1 which as unique accessors for obtaining the information you are looking for.
I have opened CAMEL-5251 for this issue and attached a modified SnmpConverters.java which creates version 1 messages that look like this:
<snmp><entry><agentaddress>1.2.3.4</agentaddress></entry><entry><enterpriseoid>1.3.6.1.6.3.1.1.5.5</enterpriseoid></entry><entry><generictrapid>0</generictrapid></entry><entry><specifictrapid>0</specifictrapid></entry><entry><sysuptime>10</sysuptime></entry></snmp>
I work with snmp messages very often and I am also new to camel so please feel free to correct any mistakes I may have made either in the usefulness of the snmp message I constructed or the manner of implementation within the camel-snmp module.
Regards,
Ed
________________________________________
From: Claus Ibsen [claus.ibsen@gmail.com]
Sent: May 2, 2012 5:40 AM
To: users@camel.apache.org
Subject: Re: SNMP traps - missing information in the Camel message?
Hi
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 Camel.
On Wed, May 2, 2012 at 12:53 PM, Jonathan Barber <jo...@gmail.com> 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://0.0.0.0:1162?type=TRAP"/>
> <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 127.0.0.1:1162
> SNMPv2-MIB::authenticationFailure 1.2.3.4 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 (1.2.3.4), 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>1.3.6.1.2.1.1.3.0</oid><value>11 days,
> 23:15:58.58</value></entry><entry><oid>1.3.6.1.6.3.1.1.4.1.0</oid><val
> ue>1.3.6.1.6.3.1.1.5.5</value></entry><entry><oid>1.3.6.1.2.1.1.6.0</o
> id><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 <jo...@gmail.com>
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
RE: SNMP traps - missing information in the Camel message?
Posted by Ed Manero <em...@xmatters.com>.
Hi Jonathan/Claus,
It looks like there is a deficiency in camel-snmp. SnmpConverters.java only uses org.snmp4j.PDU.getVariableBindings() to construct a camel message based on snmp traps received by the component. However this is only supported for v2c and v3 type messages. Version 1 messages are represented by a subclass org.snmp4j.PDUv1 which as unique accessors for obtaining the information you are looking for.
I have opened CAMEL-5251 for this issue and attached a modified SnmpConverters.java which creates version 1 messages that look like this:
<snmp><entry><agentaddress>1.2.3.4</agentaddress></entry><entry><enterpriseoid>1.3.6.1.6.3.1.1.5.5</enterpriseoid></entry><entry><generictrapid>0</generictrapid></entry><entry><specifictrapid>0</specifictrapid></entry><entry><sysuptime>10</sysuptime></entry></snmp>
I work with snmp messages very often and I am also new to camel so please feel free to correct any mistakes I may have made either in the usefulness of the snmp message I constructed or the manner of implementation within the camel-snmp module.
Regards,
Ed
________________________________________
From: Claus Ibsen [claus.ibsen@gmail.com]
Sent: May 2, 2012 5:40 AM
To: users@camel.apache.org
Subject: Re: SNMP traps - missing information in the Camel message?
Hi
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
Camel.
On Wed, May 2, 2012 at 12:53 PM, Jonathan Barber
<jo...@gmail.com> 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://0.0.0.0:1162?type=TRAP"/>
> <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 127.0.0.1:1162
> SNMPv2-MIB::authenticationFailure 1.2.3.4 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 (1.2.3.4), 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>1.3.6.1.2.1.1.3.0</oid><value>11 days,
> 23:15:58.58</value></entry><entry><oid>1.3.6.1.6.3.1.1.4.1.0</oid><value>1.3.6.1.6.3.1.1.5.5</value></entry><entry><oid>1.3.6.1.2.1.1.6.0</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 <jo...@gmail.com>
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: SNMP traps - missing information in the Camel message?
Posted by Willem Jiang <wi...@gmail.com>.
I'm working on it now :)
On Fri May 11 07:07:18 2012, Jonathan Barber wrote:
> On 2 May 2012 13:40, Claus Ibsen<cl...@gmail.com> wrote:
>> Hi
>>
>> 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.
>
> I've added another patch
> (https://issues.apache.org/jira/browse/CAMEL-5270) to add the address
> that the SNMP trap was sent from and the community it was sent with to
> the message header.
>
> Cheers
--
Willem
----------------------------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: SNMP traps - missing information in the Camel message?
Posted by Jonathan Barber <jo...@gmail.com>.
On 2 May 2012 13:40, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> 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.
I've added another patch
(https://issues.apache.org/jira/browse/CAMEL-5270) to add the address
that the SNMP trap was sent from and the community it was sent with to
the message header.
Cheers
--
Jonathan Barber <jo...@gmail.com>
Re: SNMP traps - missing information in the Camel message?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
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
Camel.
On Wed, May 2, 2012 at 12:53 PM, Jonathan Barber
<jo...@gmail.com> 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://0.0.0.0:1162?type=TRAP"/>
> <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 127.0.0.1:1162
> SNMPv2-MIB::authenticationFailure 1.2.3.4 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 (1.2.3.4), 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>1.3.6.1.2.1.1.3.0</oid><value>11 days,
> 23:15:58.58</value></entry><entry><oid>1.3.6.1.6.3.1.1.4.1.0</oid><value>1.3.6.1.6.3.1.1.5.5</value></entry><entry><oid>1.3.6.1.2.1.1.6.0</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 <jo...@gmail.com>
--
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/