As you may know, Apache Camel has a SNMP component (http://camel.apache.org/snmp.html) able to poll devices or receive SNMP traps.
Here is a very simple Camel route example that we used to get started with the camel-snmp component:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Configures the Camel Context-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:camel="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
So, the snmp-camel component has many configuration options but you basically have to provide the following:
Additionally, you have the following options:
On our example, we added the following (additionally to the hostname and port number of the host we wanted to get information from) to test the configuration:
protocol=UDP - You can either use UDP or TCP protocols
type=POLL - You can enter POLL or TRAP to define whether the camel component is going to poll the device for info and create a listener for SNMP trap events
delay=10 - Frequency you want to poll the device for information
oids=126.96.36.199.188.8.131.52.0 - In this particular example, we setup the OID which retrieves the amount of time the device is up (http://www.oid-info.com/get/184.108.40.206.220.127.116.11.0)
The last piece of our Camel route was just a log component because we wanted to see what was coming back from the device. That's all!
We also used the FUSE IDE to rapidly test the scenario we wanted and that was pretty straightforward. The FUSE IDE can be downloaded from (http://fusesource.com/products/fuse-ide-camel/).
Don't forget to include camel-snmp as a dependency in your pom.xml file if you're using Maven which
should be like this:
Enjoy the ride!