This sample is in <TalendRuntimePath>/examples/talend/tesb/cxf-jmx
directory and consists of a number of parts:
Directory |
Description |
---|---|
client/ | a sample client application that uses the CXF JAX-WS API to create a SOAP client and make several calls with it. |
common/ | code that is common for both the client and the server. |
features/ | example features for use in OSGi deployment. |
service/ | the CXF web service provider packaged as an OSGi bundle. |
war/ | A WAR archive containing code from common and service modules. This is for Servlet container use only, not used in OSGi deployment. |
From the base directory of the sample, the maven
pom.xml
file can be used to build and run the democd cxf-jmx
mvn install
Start Talend Runtime container:
trun.sh (on Linux)
trun.bat (on Windows)
Add cxf-jmx example features URL. Type this command in Talend Runtime container:
feature:repo-add mvn:org.talend.esb.examples/cxf-jmx-feature/6.5.1/xml
Install cxf-jmx example feature into the Talend Runtime container
feature:install cxf-jmx-service
You can find wsdl at
http://localhost:8040/services/simpleService?wsdl
.Now run the client; from cxf-jmx folder run:
mvn exec:java -pl client
Note: this will include some deliberate errors (to simulate failed requests), which you can ignore:
[...] Hi Alex! Hi Alex! Hi Alex! 2 4 6 8 10 [WARNING] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [...]
After the SOAP calls on the web service have completed, in JConsole, under
org.apache.cxf
you'll see thePerformance.Counter.Server
folder, where CXF MBeans with their attributes will be listed (see Monitoring Hyperic Plugins for more details).
Now we do the Nagios monitoring:
Add the template configuration file to the existing
nagios.cfg
, here are some examples, which depend on where your installation puts config files:In
/usr/local/nagios/etc/nagios.cfg
add:cfg_file=/usr/local/nagios/etc/objects/cxf_host.cfg
Or in
/etc/nagios3/nagios.cfg
add:cfg_file=/etc/nagios3/etc/objects/cxf_host.cfg
Then, restart Nagios for the changes to take effect.
# service nagios restart
Note: the name of this service may vary, depending on which package you used to install Nagios, so it may be called, for example,
nagios3
, instead ofnagios
.Login to the Nagios Web Interface
http://<nagios_host>/<nagios_server>/
for example:http://localhost/nagios/
,http://192.168.1.10/nagios3/
orhttp://192.168.198.5/nagios/
.There, you will find the status of metrics for cxf-jmx example.