This article describes deploying Stream-JMX on WebSphere Application Server (WAS) and WebSphere Liberty Server. It outlines servlet setup, logging configuration, and JMX monitoring via the web interface.
Generic Servlet Page Features
Top of the page is dedicated to list Stream-JMX used properties.
Change properties as you like in input field and press Submit button to apply changes. JMX sampler service will restart and changes will apply instantly without restarting servlet or web container.
tnt4j.properties file is displayed below. You can change that online. Press Submit TNT4.config to update configuration. JMX sampler service will restart.
Below you can see Stream-JMX console output. Refresh page or click Update button to update console contents.
WebSphere Application Server (WAS)
Build Stream-JMX and find opt/tnt4j-stream-jmx-was-*.ear in distribution build directory or archives produced.
Login to WebSphere Integrated Solutions Console and install TNT4J-Stream-JMX ear you've built:
- Navigate Applications->New application and choose New Enterprise Application. Choose file you have built and install Stream-JMX application you usually do, or following IBM's instructions. Keep in mind context path.
- Start the application.
By default, Stream-JMX connects to local WAS runner JVM using com.ibm.websphere.management.AdminServiceFactory.getMBeanFactory().
Navigate to http://localhost:9080/YOUR_CHOSEN_CONTEXT_PATH/. TNT4J-Stream-JMX configuration/monitoring page should be displayed. See Generic servlet page features for what is available there.
Stream-JMX logging on WAS can be performed by WAS Admin console:
-
Troubleshooting->[your server instance]->Change log detail levels-> selectConfiguration/Runtimetab ->Components and Groups->Components-> expandAll components-> expandcom.jkoolcloud.tnt4j.*-> selectcom.jkoolcloud.tnt4j.stream.jmx*node -> scroll to the bottom of the tree and select level you would like to use. -
Troubleshooting->[your server instance]->Change log detail levels-> selectConfiguration/Runtimetab -> into text area paste: com.jkoolcloud.tnt4j.stream.jmx.*=finer(changefinerto the level you would like to use).
See Generic servlet page features.
WebSphere Liberty Server
Build Stream-JMX and find opt/tnt4j-stream-jmx-liberty-war-*.war in distribution build directory or archives produced.
There is a simple Liberty server.xml configuration required to run Stream-JMX servlet:
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>webProfile-7.0</feature>
<feature>restConnector-1.0</feature>
<feature>localConnector-1.0</feature>
<feature>monitor-1.0</feature>
<feature>j2eeManagement-1.1</feature>
</featureManager>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
httpPort="9080"
httpsPort="9443"
host="*"/>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<webContainer deferServletLoad="false"/>
<auth-method>BASIC</auth-method>
<basicRegistry id="basic" realm="default">
<user name="Admin" password="admin" />
<user name="JMXManager" password="jmxAdmin" />
</basicRegistry>
<administrator-role>
<user>Admin</user>
</administrator-role>
<!-- Configure Stream-JMX logging level, e.g. to get DEBUG entries -->
<logging traceSpecification="*=info:com.jkoolcloud.tnt4j.stream.jmx.*=finer" />
<application contextRoot="tnt-jmx" location="tnt4j-stream-jmx-liberty-war-12.0.5.war" type="war" id="tnt-jmx" name="tnt-jmx">
<application-bnd>
<security-role name="StreamJmxManager">
<user name="JMXManager" />
<run-as userid="JMXManager" />
</security-role>
</application-bnd>
</application>
</server>By default, Stream-JMX connects to local Liberty runner JVM using java.lang.management.ManagementFactory.getPlatformMBeanServer().
Navigate to http://localhost:9080/YOUR_CHOSEN_CONTEXT_PATH/. TNT4J-Stream-JMX configuration/monitoring page should be displayed. See Generic servlet page features for what is available there.