Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 111. SNMP
SNMP Component 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The snmp: component gives you the ability to poll SNMP capable devices or receiving traps.
URI format 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
snmp://hostname[:port][?Options]
snmp://hostname[:port][?Options]
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&...
Options 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
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: 127.0.0.1:162
|
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="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"
|
The result of a poll 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Given the situation, that I poll for the following 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
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
The result will be the following:
As you maybe recognized there is one more result than requested....1.3.6.1.2.1.1.1.0. 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.
Examples 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Polling a remote device:
snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0
snmp:192.168.178.23:161?protocol=udp&type=POLL&oids=1.3.6.1.2.1.1.5.0
Setting up a trap receiver (no OID info is needed here!):
snmp:127.0.0.1:162?protocol=udp&type=TRAP
snmp:127.0.0.1:162?protocol=udp&type=TRAP
From Camel 2.10.0, you can get the community of SNMP TRAP with message header 'securityName', peer address of the SNMP TRAP with message header 'peerAddress'.
Routing example in Java (converts the SNMP PDU to XML String):
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");
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");