Run monitoring applications
After you develop a performance monitoring application, you can being using it to collect PMI data. If you plan to run your performance monitoring application in a secured environment, edit the appropriate properties file. For more information, see Run monitoring applications with security enabled.
Obtain the pmi.jar and pmiclient.jar files. The pmi.jar and pmiclient.jar files are required for client applications that use PMI client APIs. The pmi.jar and pmiclient.jar files are distributed with WebSphere Application Server and are also a part of WebSphere Java thin client package. You can get these files from either a WebSphere Application Server installation or WebSphere Java Thin Application Client installation. You also need the other JAR files in WebSphere Java Thin Application Client installation in order to run a PMI application.
Compile the PMI application, and specify it in the classpath.
To compile your PMI application, include these JAR files in the classpath:
- admin.jar
- wsexception.jar
- jmxc.jar
- pmi.jar
- pmiclient.jar
If your monitoring applications use APIs in other packages, also include those packages on the classpath.
Run the application with this script:
call "~dp0setupCmdLine.bat" set WAS_CP=%WAS_HOME%\lib\properties set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\pmi.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\pmiclient.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\ras.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\admin.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\wasjmx.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\j2ee.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\soap.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\soap-sec.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\nls.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\wsexception.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\ws-config-common.jar set WAS_CP=%WAS_CP%;%WAS_HOME%\lib\namingclient.jar %JAVA_HOME%\bin\java "%CLIENTSOAP%" "%CLIENTSAS%" "-Dws.ext.dirs=%WAS_EXT_DIRS%" %DEBUGOPTS% -classpath "%WAS_CP%" com.ibm.websphere.pmi.PmiClientTest host port connectorTypeTo run the application, run the setupClient script from Qshell to set up the correct environment. For example, if your program is named PmiClientTest, run these commands:
STRQSH . /QIBM/ProdData/WebAS5/Base/bin/setupClient -instance instance java $JAVA_FLAGS_EXT -classpath cp PmiClientTest host name [port] [connectorType]where instance is the name of you WebSphere Application Server instance and cp is a classpath that contains the PmiClientTest program.