SNMP Component

Available as of Camel 2.1

The snmp: component gives you the ability to poll SNMP capable devices or receiving traps.

Maven users will need to add the following dependency to their pom.xml for this component:

    <!-- use the same version as your Camel core version -->

URI format


The component supports polling OID values from an SNMP enabled device and receiving traps.

You can append query options to the URI in the following format, ?option=value&option=value&...


Name Default Value Description
type none The type of action you want to perform. Actually you can enter here POLL or TRAP. The value POLL will instruct the endpoint to poll a given host for the supplied OID keys. If you put in TRAP you will setup a listener for SNMP Trap Events.
address none This is the IP address and the port of the host to poll or where to setup the Trap Receiver. Example:
protocol udp Here you can select which protocol to use. You can use either udp or tcp.
retries 2 Defines how often a retry is made before canceling the request.
timeout 1500 Sets the timeout value for the request in millis.
snmpVersion 0 (which means SNMPv1) Sets the snmp version for the request.
snmpCommunity public Sets the community octet string for the snmp request.
delay 60 seconds Defines the delay in seconds between to poll cycles.
oids none Defines which values you are interested in. Please have a look at the Wikipedia to get a better understanding. You may provide a single OID or a coma separated list of OIDs. Example: oids=",,,"

The result of a poll

Given the situation, that I poll for the following OIDs:


The result will be the following:

Result of toString conversion
<?xml version="1.0" encoding="UTF-8"?>
    <value>6 days, 21:14:28.00</value>
    <value>My Very Special Printer Of Brand Unknown</value>

As you maybe recognized there is one more result than requested....
This one is filled in by the device automatically in this special case. So it may absolutely happen, that you receive more than you prepared.


Polling a remote device:


Setting up a trap receiver (Note that no OID info is needed here!):


Routing example in Java: (converts the SNMP PDU to XML String)


See Also

© 2004-2011 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram