camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > SNMP
Date Wed, 23 Sep 2009 09:55:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CAMEL/SNMP">SNMP</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~lhein">Lars
Heinemann</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h2><a name="SNMP-SNMPComponent"></a>SNMP Component</h2>

<p><b>Available as of Camel 2.1</b></p>

<p>The <b>snmp:</b> component gives you the ability to poll SNMP capable
devices or receiving traps.</p>

<h3><a name="SNMP-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
snmp:<span class="code-comment">//hostname[:port][?Options]</span>
</pre>
</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, <tt>?option=value&amp;option=value&amp;...</tt></p>

<h3><a name="SNMP-Options"></a>Options</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>type</tt> </td>
<td class='confluenceTd'> The type of action you want to perform. Actually you can enter
here <tt>poll</tt> or <tt>trap</tt>. The value <tt>poll</tt>
will instruct the endpoint to poll a given host for the supplied OID keys. If you put in <tt>trap</tt>
you will setup a listener for SNMP Trap Events. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>address</tt> </td>
<td class='confluenceTd'> This is the IP address and the port of the host to poll or
where to setup the Trap Receiver. Example: <tt>127.0.0.1:162</tt></td>
</tr>
<tr>
<td class='confluenceTd'> <tt>protocol</tt> </td>
<td class='confluenceTd'> Here you can select which protocol to use. By default it will
be <tt>udp</tt> protocol but you may want to use <tt>tcp</tt> as well
</td>
</tr>
<tr>
<td class='confluenceTd'> <tt>retries</tt> </td>
<td class='confluenceTd'> Defines how often a retry is made before canceling the request.
(Default: <tt>2</tt>) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>timeout</tt> </td>
<td class='confluenceTd'> Sets the timeout value for the request in millis. (Default:
<tt>1500</tt>) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>snmpVersion</tt> </td>
<td class='confluenceTd'> Sets the snmp version for the request. (Default: <tt>0</tt>
which means SNMPv1) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>snmpCommunity</tt> </td>
<td class='confluenceTd'> Sets the community octet string for the snmp request. (Default:
<tt>public</tt>) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>delay</tt> </td>
<td class='confluenceTd'> Defines the delay in seconds between to poll cycles. (Default:
<tt>60</tt>) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>oids</tt> </td>
<td class='confluenceTd'> Defines which values you are interested in. Please have a
look at the <a 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"
</td>
</tr>
</tbody></table>

<h3><a name="SNMP-Examples"></a>Examples</h3>

<p>Polling a remote device:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
snmp:192.168.178.23:161?protocol=udp&amp;type=poll&amp;oids=1.3.6.1.2.1.1.5.0
</pre>
</div></div>

<p>Setting up a trap receiver (<b>Note that no OID info is needed here!</b>):</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
snmp:127.0.0.1:162?protocol=udp&amp;type=trap
</pre>
</div></div>

<p>Routing example in Java: (converts the SNMP PDU to XML String)</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
from(<span class="code-quote">"snmp:192.168.178.23:161?protocol=udp&amp;type=poll&amp;oids=1.3.6.1.2.1.1.5.0"</span>).
convertBodyTo(<span class="code-object">String</span>.class).
to(<span class="code-quote">"activemq:snmp.states"</span>);
</pre>
</div></div>

<h3><a name="SNMP-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring
Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting
Started</a></li>
</ul>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CAMEL/SNMP">View Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=3474742&revisedVersion=3&originalVersion=2">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CAMEL/SNMP?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message