On 8 May 2012 01:07, Ed Manero <eman...@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 <jonathan.bar...@gmail.com>