You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2015/02/13 15:22:06 UTC
svn commit: r940048 [2/2] - in /websites/production/camel/content:
book-component-appendix.html book-in-one-page.html cache/main.pageCache
camel-2150-release.html snmp.html
Modified: websites/production/camel/content/snmp.html
==============================================================================
--- websites/production/camel/content/snmp.html (original)
+++ websites/production/camel/content/snmp.html Fri Feb 13 14:22:05 2015
@@ -85,57 +85,25 @@
<tbody>
<tr>
<td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="SNMP-SNMPComponent">SNMP Component</h2>
-<p><strong>Available as of Camel 2.1</strong></p>
-
-<p>The <strong>snmp:</strong> component gives you the ability to poll SNMP capable devices or receiving traps.</p>
-
-<p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-<dependency>
+<div class="wiki-content maincontent"><h2 id="SNMP-SNMPComponent">SNMP Component</h2><p><strong>Available as of Camel 2.1</strong></p><p>The <strong>snmp:</strong> component gives you the ability to poll SNMP capable devices or receiving traps.</p><p>Maven users will need to add the following dependency to their <code>pom.xml</code> for this component:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-snmp</artifactId>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
]]></script>
-</div></div>
-
-<h3 id="SNMP-URIformat">URI format</h3>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-snmp://hostname[:port][?Options]
-]]></script>
-</div></div>
-<p>The component supports polling OID values from an SNMP enabled device and receiving traps.</p>
-
-<p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p>
-
-<h3 id="SNMP-Options">Options</h3>
-<div class="confluenceTableSmall">
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>type</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> none </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The type of action you want to perform. Actually you can enter here <code>POLL</code> or <code>TRAP</code>. The value <code>POLL</code> will instruct the endpoint to poll a given host for the supplied OID keys. If you put in <code>TRAP</code> you will setup a listener for SNMP Trap Events. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>protocol</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>udp</code> </p></td><td colspan="1" rowspan="1" class
="confluenceTd"><p> Here you can select which protocol to use. You can use either <code>udp</code> or <code>tcp</code>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>retries</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>2</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Defines how often a retry is made before canceling the request. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>timeout</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>1500</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Sets the timeout value for the request in millis. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>snmpVersion</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code> (which means SNMPv1) </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Sets the snmp version for the request. </p
></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>snmpCommunity</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>public</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Sets the community octet string for the snmp request. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>delay</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>60</code> seconds </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Defines the delay in seconds between to poll cycles. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>oids</code> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> none </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Defines which values you are interested in. Please have a look at the <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Object_identifier" rel="nofollow">Wikipedia </a> to
get a better understanding. You may provide a single OID or a coma separated list of OIDs. Example: oids="1.3.6.1.2.1.1.3.0,1.3.6.1.2.1.25.3.2.1.5.1,1.3.6.1.2.1.25.3.5.1.1.1,1.3.6.1.2.1.43.5.1.1.11.1" </p></td></tr></tbody></table></div>
-</div>
-
-<h3 id="SNMP-Theresultofapoll">The result of a poll</h3>
-
-<p>Given the situation, that I poll for the following OIDs:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>OIDs</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-1.3.6.1.2.1.1.3.0
+</div></div><h3 id="SNMP-URIformat">URI format</h3><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[snmp://hostname[:port][?Options]
+]]></script>
+</div></div><p>The component supports polling OID values from an SNMP enabled device and receiving traps.</p><p>You can append query options to the URI in the following format, <code>?option=value&option=value&...</code></p><h3 id="SNMP-Options">Options</h3><div class="confluenceTableSmall"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>type</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The type of action you want to perform. Actually you can enter here <code>POLL</code> or <code>TRAP</code>. The value <code>POLL</code> will instruct the endpoint to poll a given host for the supplied OID keys. If yo
u put in <code>TRAP</code> you will setup a listener for SNMP Trap Events.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>protocol</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>udp</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Here you can select which protocol to use. You can use either <code>udp</code> or <code>tcp</code>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>retries</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>2</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines how often a retry is made before canceling the request.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>timeout</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1500</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the timeout value for the request in millis.</p></td></tr><tr><td colspa
n="1" rowspan="1" class="confluenceTd"><p><code>snmpVersion</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>0</code> (which means SNMPv1)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the snmp version for the request.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>snmpCommunity</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>public</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Sets the community octet string for the snmp request.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>delay</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>60</code> seconds</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines the delay in seconds between to poll cycles. From <strong>Camel 2.15</strong> onwards the delay is using millis as its timeunit, so configure 30000 for 30 seconds. Older releases uses the value in seconds.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>oids</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>none</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Defines which values you are interested in. Please have a look at the <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Object_identifier" rel="nofollow">Wikipedia </a> to get a better understanding. You may provide a single OID or a coma separated list of OIDs. Example: oids="1.3.6.1.2.1.1.3.0,1.3.6.1.2.1.25.3.2.1.5.1,1.3.6.1.2.1.25.3.5.1.1.1,1.3.6.1.2.1.43.5.1.1.11.1"</p></td></tr></tbody></table></div></div><h3 id="SNMP-Theresultofapoll">The result of a poll</h3><p>Given the situation, that I poll for the following OIDs:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>OIDs</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[1.3.6.1.2.1.1.3.0
1.3.6.1.2.1.25.3.2.1.5.1
1.3.6.1.2.1.25.3.5.1.1.1
1.3.6.1.2.1.43.5.1.1.11.1
]]></script>
-</div></div>
-
-<p>The result will be the following:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Result of toString conversion</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
+</div></div><p>The result will be the following:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Result of toString conversion</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<snmp>
<entry>
<oid>1.3.6.1.2.1.1.3.0</oid>
@@ -159,40 +127,18 @@ snmp://hostname[:port][?Options]
</entry>
</snmp>
]]></script>
-</div></div>
-
-<p>As you maybe recognized there is one more result than requested....1.3.6.1.2.1.1.1.0.<br clear="none">
-This one is filled in by the device automatically in this special case. So it may absolutely happen, that you receive more than you requested...be prepared.</p>
-
-
-<h3 id="SNMP-Examples">Examples</h3>
-
-<p>Polling a remote device:</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0
-]]></script>
-</div></div>
-
-<p>Setting up a trap receiver (<strong>Note that no OID info is needed here!</strong>):</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-snmp:127.0.0.1:162?protocol=udp&type=TRAP
-]]></script>
-</div></div>
-<p><strong>From Camel 2.10.0</strong>, you can get the community of SNMP TRAP with message header 'securityName',<br clear="none">
-peer address of the SNMP TRAP with message header 'peerAddress'.</p>
-
-<p>Routing example in Java: (converts the SNMP PDU to XML String)</p>
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-from("snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0").
+</div></div><p>As you maybe recognized there is one more result than requested....1.3.6.1.2.1.1.1.0.<br clear="none"> This one is filled in by the device automatically in this special case. So it may absolutely happen, that you receive more than you requested...be prepared.</p><h3 id="SNMP-Examples">Examples</h3><p>Polling a remote device:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0
+]]></script>
+</div></div><p>Setting up a trap receiver (<strong>Note that no OID info is needed here!</strong>):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[snmp:127.0.0.1:162?protocol=udp&type=TRAP
+]]></script>
+</div></div><p><strong>From Camel 2.10.0</strong>, you can get the community of SNMP TRAP with message header 'securityName',<br clear="none"> peer address of the SNMP TRAP with message header 'peerAddress'.</p><p>Routing example in Java: (converts the SNMP PDU to XML String)</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[from("snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0").
convertBodyTo(String.class).
to("activemq:snmp.states");
]]></script>
-</div></div>
-
-<h3 id="SNMP-SeeAlso">See Also</h3>
+</div></div><p></p><h3 id="SNMP-SeeAlso">See Also</h3>
<ul><li><a shape="rect" href="configuring-camel.html">Configuring Camel</a></li><li><a shape="rect" href="component.html">Component</a></li><li><a shape="rect" href="endpoint.html">Endpoint</a></li><li><a shape="rect" href="getting-started.html">Getting Started</a></li></ul></div>
</td>
<td valign="top">