一直在找一款能够实时监控WebSphere的工具,今天终于在quest网站上下载到一个免费试用版的Spotlight on WebSphere,据说还不错,内存和CPU占用都比较少,并且支持Websphere6,所以迫不及待的就拿来试用一把,但是在试用过程中想要远程连接WebSphere来监控参数。
根据帮助文件中jar包生成步骤来一步一步执行,碰到一点小问题,已经成功解决,写下这篇文章记录下来:)
帮助原文如下:
If WebSphere and Spotlight are on different machines, it is strongly
recommended that you point Spotlight to a local WebSphere JAR file that you
create in the Spotlight tools folder. This file contains all the WebSphere classes
that Spotlight requires.
To create a local websphere.jar file:
1. Open a command console and navigate to the common/tools folder of the
Spotlight installation. The folder contains slfileload.jar.
2. Copy slfileload.jar to a machine on which WebSphere is installed and ensure
that there is a Java JDK 1.3+ on that machine.
3. Open a command window on the WebSphere machine and ensure that the
environment variable that specifies the location of the JDK is set.
4. From the directory where you placed slfileload.jar, issue one of the following
commands:
WebSphere 4 and WebSphere 5
java -jar slfileload.jar <appserver_folder> websphere.jar
WebSphere 6
java -jar slfileload.jar <core_folder> websphere.jar
As you see from the examples above, you point to the AppServer folder on
WebSphere 4 and 5, and the Core folder on WebSphere 6, which is located
on the target machine. Here are examples of where these folders are located
on a Windows machine:
WebSphere 4
\mymachine\WebSphere\WAS4\AppServer
WebSphere 5
\mymachine\WebSphere\WAS5\AppServer
WebSphere 6
\mymachine\WebSphere\WAS6\Core
Hint: you may want to give your file a more specific name, like
websphere4.jar, to distinguish it from another JAR file that you create
later on for WebSphere 5 or 6.
5. The command creates websphere.jar in the directory in which it was
executed. Move the created JAR to the tools folder on the machine with
your Spotlight installation.
6. When you start Spotlight and the connection dialog appears, choose the
appropriate Profiles tab and then click either Locate WebSphere Home
directory or websphere.jar file (WebSphere 4), or Locate WebSphere Jar Files
(WebSphere 5).
7. Click the Import Jar File button and point to the newly created
<SPOTLIGHT_HOME>\common\tools\websphere.jar. The JAR file is
expanded and the result is placed in Spotlight’s
<SPOTLIGHT_HOME>\data\ws4 , ws5, or ws6 folder, depending on the
version of your WebSphere server. Note that <SPOTLIGHT_HOME>
denotes the location of the Spotlight installation directory.
8. Once the files have been expanded, websphere.jar is no longer needed. You
can delete it to conserve disk space.
按照帮助文件的步骤进行jar包的生成,在第4步执行 WebSphere 6 java -jar slfileload.jar websphere.jar 命令时并没有自动生成websphere.jar文件,系统提示命令语法不对。
于是尝试使用以下命令,命令执行成功。
C:\Program Files\WebSphere\AppServer>java -jar slfileload.jar ./ websphere6.jar
这样我们的远程监控jar包就生成了:)
注:我的JDK环境为1.4.2
java -version java version "1.4.2_06"