JMX Console?

30 views
Skip to first unread message

Aaron Korver

unread,
Sep 6, 2007, 8:55:16 AM9/6/07
to Central-Iowa-J...@googlegroups.com
I'm looking for a JMX console to use with Websphere, any suggestions?

Thanks,
Aaron Korver

Travis Klotz

unread,
Sep 6, 2007, 9:24:15 AM9/6/07
to Central-Iowa-J...@googlegroups.com
I haven't used JMX much, but I went to the NFJS talk on JMX and AOP.
The interface 21 guy there said that jConsole (the console that comes
with the sun JDK 1.5+) has pretty much killed the rest of them off.
Its not supposed perfect but its considered good enough.

Travis Klotz

OpenXGroup Inc.

unread,
Sep 6, 2007, 10:41:33 AM9/6/07
to Central-Iowa-J...@googlegroups.com

First of all, I really like this gents review for anyone interested in JMX....

JMX - Java Management Extensions
http://www.ece.uic.edu/~cpress/jmx/

Let's introduce the new Mustang JConsole features by comparison with the Tiger JConsole MBeans tab look and feel.
http://blogs.sun.com/lmalventosa/entry/changes_to_the_mbeans_tab
Monitoring and Managing JMX Instrumented Applets with JConsole
http://blogs.sun.com/lmalventosa/entry/jmx_instrumented_applets_monitoring_and

JConsole from JDK 6, which has a Plugin API, would allow you to design your own GUI that appears in one or more tabs inside JConsole. The advantage is that you do not have to take care of the details of finding and connecting to the application you want to manage.  However, many find JConsole to be of value when working with JDK 6 (even thought it comes with JDK 5) or a combination of JDK 6 and NetBeans.  Otherwise, it is not uncommon to find it cumbersome to exploit the full value of the product.  It is important to be aware of what different protocol mechanisms WAS exposes the MBean server through.

http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html#gdeje
http://java.sun.com/javase/6/docs/jdk/api/jconsole/spec/com/sun/tools/jconsole/package-summary.html

Use the Remote tab in JConsole to connect to the Virtual Machine that you want to monitor. Alternatively, use the connect command-line |option, specifying a host of local host and a port number. When you launch |the application that you want to monitor, set these command-line options:

  • -Dcom.sun.management.jmxremote.port=<value> to specify the port the management agent should listen on.
  • -Dcom.sun.management.jmxremote.authenticate=false to disable authentication unless you have created a username file.
  • -Dcom.sun.management.jmxremote.ssl=false to disable SSL encryption.
Another option is to use admin client api which are specific to WebSphere built on JMX extns.

From WebSphere tech journal..."The Application Server administration programming API is fully documented in the javadoc, which is provided with every installation (it is located in the web/apidocs directory under Application Server's root installation directory). The Application Server administration API is based on standard JMX interfaces and classes, and the JMX javadoc is also provided with each installation. The com.ibm.websphere.management package contains the public Application Server management interface."

If you are trying to programatically create MBeans for your own resources then you have to define MBean interfaces for them. If you want to implement and/or register your own MBeans, you are venturing into non-application server-specific territory. In addition to implementing your own MBeans, you will have to implement your own means of harvesting your metrics and/or managing your resources.

(If Applicable) Note: Data collection for the J2EE Domain MBean is not available in a IBM(R) WebSphere(R) Application Server cluster environment.
http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/index.jsp?topic=/com.ibm.itcamwas_b.doc_6.1/rev/dc_ws_basic81.htm
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/cjmx_proxymodel.html

Extending the WebSphere Application Server administrative system with custom MBeans
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/tjmx_extend.html

Not all WebSphere XD components are exposed via MBeans. Use the configuration service to manipulate components and artifacts that are not exposed via Mbeans.
http://www.ibm.com/developerworks/websphere/library/techarticles/0707_lepech/0707_lepech.html

This may or may not be helpful but certainly good to be aware of before any configuration frustration might set in:
Connecting to 'DeploymentManager' is better also because is this component that works as the 'master agent' in the mbean federation infrastructure but remember that SOAP is not supported by the JConsole and AFAIK the preferred ibm's protocol is SOAP. I think you have to try changing the preferred JMXConnector using WAS's admin console and see if some service url works.
http://forum.springframework.org/showthread.php?t=38246
http://forum.springframework.org/showthread.php?t=19615&highlight=MBeanExporter

MBeanInspector for WebSphere Application Server
A Java Management Extensions (JMX) management browser for WebSphere5.

http://www.alphaworks.ibm.com/tech/mbeaninspector

JMX Scripts with Eclipse Monkey
http://jmesnil.net/weblog/2007/05/23/jmx-scripts-with-eclipse-monkey/

There are many use cases where you have to perform theses steps in repetition. It's tedious to do that in a JMX console ( e.g. jconsole or eclipse-jmx) and most of the time, it is not worth writing a Java application.

These use cases beg to be scripted.

We will again use jconsole as our managed java application (see this previous post to start jconsole with all System properties required to manage it remotely).

To run the example:

  1. install Eclipse Monkey
JMX Console for Eclipse IDE
http://code.google.com/p/eclipse-jmx/

MC4J Supported Servers

IBM WebSphere 5.0, 5.1, 6.0
http://mc4j.org/confluence/display/mc4j/Home

http://manageengine.adventnet.com/products/applications_manager/jmx-console-snmp-console.html

Good food for thought......

The ObjectGrid JMX and MBean administration model was created to take advantage of the various JMX consoles that are available for administering JMX environments. You can put together dashboards using the JMX console of your choice. Consoles can be attached to the MBeans running on the management gateway Java virtual machine (JVM) and dashboards can be assembled using these MBeans. Consoles offer graphical histories or charts of numerical and string values.
http://www-03.ibm.com/developerworks/wikis/display/objectgridprog/Management+gateway+process+overview
http://www-03.ibm.com/developerworks/wikis/display/objectgridprog/Administering+with+JMX+MBean+interfaces

OpenXGroup Inc.

unread,
Sep 8, 2007, 5:50:55 PM9/8/07
to Central-Iowa-J...@googlegroups.com
Guess someone should write an article like this but for WebSphere 5.x and 6.x

You will want to check the version of JMX since I don't think it's possible to force your application server to use a newer version of JMX. I believe the only way to do that is to upgrade your application server.  However I have little IBM WebSphere internals experience, more with BEA WebLogic, so I may be wrong about that - it's a question you should ask Websphere support.

This gent is the JMX guru with Sun....http://weblogs.java.net/blog/emcmanus/

Eamonn authored this article as well.....

Java API Design Guidelines
by Eamonn McManus
http://www.artima.com/weblogs/viewpost.jsp?thread=142428
List of changes to JMX specification for version 1.2
eamonn....@sun.com
http://www.jcp.org/aboutJava/communityprocess/maintenance/jsr003/jmx1.2-change-log.txt

more info:
http://jcp.org/aboutJava/communityprocess/maintenance/jsr003/final_list.html
http://weblogs.java.net/blog/emcmanus/archive/2005/07/dealing_with_mu.html

This is another great resource....
http://blogs.sun.com/jmxetc
http://blogs.sun.com/jmxetc/entry/easy_is_not_always_simple

Nice Spring JMX and MBeans overview
http://www-128.ibm.com/developerworks/java/library/j-springjmx/

Starting MX4J Server from Spring with registered HttpAdaptor

http://blogger.xs4all.nl/kuip/archive/2006/01/20/75092.aspx

Remotely monitor Tomcat clusters using MC4J

Add the power of JMX to Tomcat

http://www.javaworld.com/javaworld/jw-08-2005/jw-0801-jmx.html

J2SE 5.0 comes with a JMX client tool called JConsole that can be used to look into the runtime JVM details. Tomcat installation includes a JMX servlet called JMXProxyServlet that can view and update Tomcat MBean attributes. It is a lightweight proxy for viewing and manipulating the MBeans running in a Tomcat container and proves helpful in integrating command line scripts for monitoring and changing Tomcat internals. JMX Query and Set commands can be used to query the MBeans and modify their attributes and operations respectively.

Other than these two tools, several third-party open source JMX client applications are available (links to which are available in Resources): http://www.javaworld.com/javaworld/jw-08-2005/jw-0801-jmx.html#resources

In this article, I discuss how to install and configure MC4J to remotely connect to a Tomcat servlet container and monitor all the MBean components in a server cluster.

http://mx4j.sourceforge.net/
http://www.aloba.ch/produkte/veroeffentlichungen/tomcatusermanager/installation.html

Connecting MC4J to MX4J

http://mc4j.org/confluence/display/MC4J/MX4J

http://forum.springframework.org/archive/index.php/t-23424.html
..."It turned out to be a problem with the classpath and the order of the jars. Complicated even further because I'm using the Maven Eclipse plugin. I ended up having to rename the jar and add it to my project manually, putting it first in the list for the classpath."

nifty toy = Tomcat + MX4J + hivemind.management + mc4j

Everything else works cleanly out of the box. It's fun to watch your services drawing nice performance-graphs - just too cool.
http://marcus-schulte.blogspot.com/2005/07/nifty-toy-tomcat-mx4j.html

GREAT READ!!!!

JMX - Java Management Extension - paving the way for manageable applications (JavaOne 2007) by Lucas Jellema

http://technology.amis.nl/blog/?p=1945

Using Spring to expose MBeans


By pairing up JMX and Spring, JMX enabling an application becomes much easier and with less (or even any) impact on the application. Spring has extensive support for JMX: publish POJOs as MBeans - no special interface or naming convention or use the MBeanInfoAssemblerAPI in combination with Class annotations that describe which classes to expose as MBeans: Automatically registers beans as MBeans that have the @ManagedResource annotation.

One of the many things Spring can do to beans it instantiates is publish them as MBeans.

http://forum.springframework.org/archive/index.php/t-23460.html
I want to update this thread with my results: I did not find a way to make JMX work with Tomcat 5.5 & JDK 1.4, so I use JDK 1.5 to run Tomcat.

This is for dev, my real production server will be websphere 6 which uses JDK 1.4, so I still have to figure this part out..

>>>>>  So, there is a need indeed for an article or two to be written or maybe a presentation!!!!


Aaron Korver

unread,
Sep 9, 2007, 10:10:09 PM9/9/07
to Central-Iowa-J...@googlegroups.com
MC4J just doesn't play nicely with Websphere.  And so far, no luck hooking up JConsole because Websphere runs on IBM's JVM, not Sun's.  I really haven't put a whole bunch of effort into it though, was testing the waters to see if anyone in the group had any experience with JMX and Websphere.

The main reason is to use Log4J's JMX beans to manage logging levels at runtime.  Yes, I know Log4J has its own watchdog thread to pick up configuration changes, but the JMX option seemed to be a better approach.  Simply because usually the log4j.properties file is packaged up within the WAR or EAR and we aren't exploding the archives to deploy.

Ah the joys of life!

Thanks,
Aaron
Reply all
Reply to author
Forward
0 new messages