Description:
When using JMX to monitor service container environment data, you need to use each parameter query name, the following lists the monitoring code under each container and the configuration of the query parameter name:
Java Implementation Example:
Import Javax.management.MBeanServer;
try{
//Like Tomcat get ThreadPool information
String squeryname = "catalina:type=threadpool,*";
Mbeanserver mbs = Managementfactory.getplatformmbeanserver ();
ObjectName threadpoolobjname = new objectname (squeryname);
set<objectname> s = mbs.querynames (threadpoolobjname, null);
for (objectname obj:s) {
System.out.println (mbs.getattribute (obj, "maxthreads"));
System.out.println (Mbs.getattribute (obj, "Currentthreadcount"));
System.out.println (Mbs.getattribute (obj, "currentthreadsbusy"));
System.out.println (Mbs.getattribute (obj, "name"));
}
catch (Javax.management.JMRuntimeException Jmre) {
}
parameter configuration:
———————————————————————————————————————————————
Tomcat
Java.lang:type=runtime
Java.lang:type=operatingsystem
Catalina:type=server
Memory_mxbean_name
catalina:type=manager,*
catalina:type=threadpool,*
catalina:type=globalrequestprocessor,*
catalina:j2eetype=servlet,*
catalina:type=datasource,class=javax.sql.datasource,*
Glassfish
Com.sun.appserv:j2eetype=j2eeserver,name=server,category=runtime
Amx:pp=/j2eedomain,type=j2eeserver,name=server,j2eetype=j2eeserver
Java.lang:type=operatingsystem
Memory_mxbean_name
Thread_mxbean_name
Com.sun.appserv:j2eetype=j2eeserver,name=server,category=runtime
Amx:j2eetype=j2eeserver,name=server
Amx:pp=/j2eedomain,type=j2eeserver,name=server,j2eetype=j2eeserver
Java.lang:type=operatingsystem
Com.sun.appserv:j2eetype=webmodule
Com.sun.appserv:type=globalrequestprocessor
Com.sun.appserv:j2eetype=j2eeapplication
Com.sun.appserv:j2eetype=servlet
Com.sun.appserv:j2eetype=ejbmodule
Com.sun.appserv:j2eetype=jdbcresource
Com.sun.appserv:j2eetype=jmsresource
Com.sun.appserv:type=threadpool
Com.sun.appserv:type=manager
Com.sun.appserv:type=connector
Com.sun.appserv:type=selector
JBoss
Jboss.system:type=server
Jboss.as:management-root=server
Jboss.as:management-root=server
Jboss.system:type=server
Jboss.as:management-root=server
Java.lang:type=runtime
Java.lang:type=operatingsystem
Memory_mxbean_name
Java.lang:type=operatingsystem
jboss.j2ee:service=ejb3,name=*,*
jboss.web:type=threadpool,*
jboss.jdbc:service=metadata,datasource=*
jboss.web:type=globalrequestprocessor,*
jboss.web:j2eetype=webmodule,*
jboss.web:j2eetype=servlet,*
jboss.web:type=manager,*
WebLogic
Com.bea:name=domainruntimeservice,type= Weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean
Applicationruntimes
Webappcomponentruntime
Jdbcdatasourceruntime
Jmscomponentruntime
Jdbcmultidatasourceruntime
Ejbcomponentruntime
WebSphere
Websphere:type=jvm
websphere:type=server,*
Websphere:type=sessionmanager,
Websphere:type=servlet,
websphere:type=jdbcprovider,*
websphere:type=threadpool,*
websphere:type=ejbmodule,*
WebSphere website JMX mbean Description:
Https://www.ibm.com/support/knowledgecenter/zh/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_mbeans_list.html