Before you begin
This sample is in <TalendRuntimePath>/examples/talend/tesb/cxf-jmx directory and consists of a number of parts:
|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 demo.
Start Talend Runtime Container:
Add cxf-jmx example features URL. Type this command in Talend Runtime Container:
Install cxf-jmx example feature into the Talend Runtime Container
- You can find wsdl at http://localhost:8040/services/simpleService?wsdl.
Now run the client; from cxf-jmx folder run:
mvn exec:java -pl clientNote: 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 the Performance.Counter.Server folder, where CXF MBeans with their attributes will be listed.
What to do next
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.cfgOr in /etc/nagios3/nagios.cfg add:
- Then, restart Nagios for the changes to take
# service nagios restartNote: 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 of
- Login to the Nagios Web Interface http://<nagios_host>/<nagios_server>/ for example: http://localhost/nagios/, http://192.168.1.10/nagios3/ or http://192.168.198.5/nagios/.There, you will find the status of metrics for cxf-jmx example.