Monitoring using the OUAF Part 2: JMX
By Acshorten-Oracle on Feb 13, 2009
One of the recent additions to the OUAF is the ability to use JMX to help monitor and administrate the product. A bit of background first, JMX stands for Java Management Extensions. It provides a standard way of accessing and manipulating internal information involved in the operations of java based technology. For more information about the potential and the scope of the API see the standard Sun JMX documentation.
This entry will concentrate on how to enable JMX and extract information.
By default, JMX is not enabled in Java 5 (I heard that Java 6 may have it enabled by default but I have not found anything confirming that). To do this you have to add some options to the java command line. The details of the command line options available (and there are a few combinations) are document at the Sun JMX site.
This can be enabled in the OUAF in the following areas:
- Online/XAI - You can add the options in the J2EE console (if the command line is visible) or modifying the scripts that start the J2EE Web Application Server.
- Batch - You can add the options in the threadpoolworker options. Refer to the documentation for details of this. Note: This is only supported in V2.2 and above only.
When you enable it, the JMX information is available on a port that broadcasts the information. This port can be secured or not (part of the enabling process configures the port and the security). Remember that JMX is not only for monitoring but MANAGEMENT so it should be secured to avoid the wrong people controlling the applications.
The next step is to point a JMX browser to the port to display the relevant JMX information. For publishing purposes the JMX browser used will be jconsole for examples. It is the one provided with the Java SDK but you can use similar techniques on other JMX browsers such as Enterprise Manager, Tivoli and MC4J etc.
You can start the JMX console using the jconsole command. If you want to monitor C3P0 connection pools then you should ensure that C3P0 java classes are in the path:
Now once you open the browser you will see a tree of statistics. Each of the entries in the tree is a JMX collection point that provides statistics. These statistics vary from class to class but provide valuable statistics in the "Attributes" section.
If you are looking for batch statistics then you should review the Batch Operations Guides on Metalink 753301.1 which outlines the statistics available.
If you are looking at online statistics then you should review the Operations and Configuration Guides on Metalink 753303.1 which outlines the statistics available.
If you are looking at C3P0 statistics then you should review the C3P0 site for details.
You can also get detailed Java 5 statistics from the JMX then look at the following example.
Take time to explore the statistics available and you can even configure your console to track and display the information.