|
Page Created :
SM :
servicemix-snmp
servicemix-snmp has been created by Lars Heinemann (Oct 17, 2008). Content:ServiceMix SNMPThe ServiceMix SNMP component provides support for receiving SNMP
InstallationInstalling the servicemix-snmp component can be done in several ways:
Note that when using ant tasks, the component is not started, you will have to start it manually using ant tasks or a console. CreationYou can use Maven to create a service unit. mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-snmp-service-unit \
-DgroupId=com.mycompany.myproduct \
-DartifactId=mycomponent.artifact
The following table shows the additional configuration possibilities of the endpoint other than the configuration of the default PollingEndpoint class.
The addressThe address has to be specified in the following way: Template: <protocol>:<ip-address>/<port> Example: udp:192.168.2.122/161
Provider Endpoint (Sending)
For all xbean file endpoint configuration take a look at Xml schemas MarshalersYou can write your own marshalers for conversion between snmp and normalized message. The SnmpMarshalerSupport interfaceFor providing your own marshaler you only need to implement a single methods: convertToJBI(...)This method is responsible for translating a received snmp response into a jbi compliant normalized message ready to be sent to the bus. After finishing your marshaler you can simply configure your endpoints to use it: Marshaler example <snmp:poller service="test:mySNMPService" endpoint="pollerEndpoint" targetService="test:myProcessor" period="10000" address="udp:192.168.2.122/161" file="classpath:myOIDList.txt"> <property name="marshaler"> <bean class="com.mycompany.MySNMPMarshaler" /> </property> </snmp:poller> How does the DefaultSnmpMarshaler work?Given the situation, that I provide a file like this: myOIDList.txt 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: Result of DefaultSnmpMarshaler <?xml version="1.0" encoding="UTF-8"?> <snmp> <entry> <oid>1.3.6.1.2.1.1.3.0</oid> <value>6 days, 21:14:28.00</value> </entry> <entry> <oid>1.3.6.1.2.1.25.3.2.1.5.1</oid> <value>2</value> </entry> <entry> <oid>1.3.6.1.2.1.25.3.5.1.1.1</oid> <value>3</value> </entry> <entry> <oid>1.3.6.1.2.1.43.5.1.1.11.1</oid> <value>6</value> </entry> <entry> <oid>1.3.6.1.2.1.1.1.0</oid> <value>My Very Special Printer Of Brand Unknown</value> </entry> </snmp> As you maybe recognized there is one more result than requested....1.3.6.1.2.1.1.1.0. |
Unsubscribe or edit your notifications preferences
