I would like to use JConsole to monitor my Websphere application, but I am not sure how to enable JMX.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You cannot set the required system properties through the WAS console, because it does not allow you specify empty values. Instead, you have to insert the following at the bottom of 'server.xml':
Look at the following simple method to connect jconsole to Websphere 6.1
It does works for me (Solaris, Was 6.1, Sun JVM), it also works with Visual VM
Enjoy !
Ok. There are two ways to do this: one using SOAP connector one using RMi/IIOP connector.
For SOAP you need to do WAS setup to add a new PORT and other JVM args described above. But all you get once JConsole connects to the server are basic JVM metrics.
With RMI you get everything that WebSphere exposes. All the MBeans! The only caveat is: if your WAS JVM is behind a firewall - you'd need to open a port to get to it from your desktop. But you can run this via X11 right off the app server host!
I used JDK7 on my Windows XP desktop to connect to WAS 7.0 with global security enabled. I took a script from Answer #4 above and used it as a starting point. Here's my version of it:
The WAS_HOME is just a directory where i have those IBM JARs that i downloaded from my WebSphere binaries (off Solaris). I also created two subdirs under there: properties and keystore. In the properties subdir i put my sas.client.props and ssl.client.props, also downloaded from a working WAS7 cell (i took it off of a DM). In the keystore subdir i put the key.p12 and trust.p12 files, also downloaded from a WAS7 cell. Make sure they have the right certs! If the ones from WAS/etc don't work - try the ones from ${CONFIG_ROOT}/cells/. Modify ssl.client.props to make sure the path to the p12 files is correct!
Now, in order for this to work you also have to download the following from your WAS binaries:
Put this whole directory under your SUN JDK's jre/lib directory. This takes care of the IBM JSSE2 Provider errors and such. Also, get the following three files from WAS_BIN_HOME/java/jre/lib/security:
I just overwrote the ones that came with SUN's JDK with the ones i took from IBM's.
Also, in sas.client.props be sure to enter user ID and password, similar to how you do it in soap.client.props. You can encode the password the same way. This is needed to get past Global Security's BasicAuth.
I think that's it. P.S. I'm not a Windows pro, so if there's a cleaner way to do this - please share it.
Maybe it's a little offtopic, but I have found a way to connect to WAS 7.0 JMX server from JConsole. No server setup is required, no AppClient, only some JARs and a little client setup.
Use the following script
If the target server has administrative security disabled, comment out CLIENTSAS and PROVIDER lines.
If the security is enabled, you will also need sas.client.props file to be put in THIS_DIR directory. The template file can be found under WAS_profile\properties directory. You will have to do a little setup. Here is an excerpt from my sas.client.props
OK :)
After connecting, the login popup will appear. Type your admin user and password (user & pw are not required on the connection dialog in JConsole)
You may run the JConsole from IBM JDK, or Sun JDK. For IBM, no other setup is required. However, for Sun you may need to put orb.properties file in your home directory. The file can be found in com.ibm.ws.ejb.thinclient_7.0.0.jar.
I also struggled for a few hours to get this to work and I found the solution. The key issue is here is SSL - the client has to use the proper keys to establish a SSL connection to the server. This involves pointing to the correct trust store location and trust store password as described here. The best way to set up the environment is to call the setupCmdLine.sh (on Windoze it is setupCmdLine.bat) for the relevant server, and then invoke jconsole like this:
you can try the following, it uses the SOAP protocol adapter. I think it's as lean a configuration possible.
Credits to my colleague Jeroen for the initial version of the script using IIOP (I'm trying SOAP in the hope that it will work with Hyperic)