jmx

Tomcat 5.5 Monitoring with JDK 1.4 on Windows

独自空忆成欢 提交于 2019-12-08 07:59:53
问题 According to this documentation http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html#Enabling_JMX_Remote it should be possible to remotely Monitor a Tomcat 5.5 Server running on a JDK 1.4 but after searching all over the web and trying multiple OSs I still am no further than on day one. My results thus far are. Settign up Tomcat with the standard -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=%my.jmx.port% -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management

Multiple Java Applications using JMX

筅森魡賤 提交于 2019-12-08 07:53:18
问题 I'm very new to JMX, and what I try to achieve is the following: I want to use JMX for monitoring multiple instances of the same Java-Application. The problem is, that this application might be run multiple times at the same time. I need the possibility to monitor the JMX values from another (remote) host. Example Java-Application: public class Test { public static void main(String[] args) { while(true) { try { Thread.sleep(1000); System.out.println("I'm running"); } catch

How to query the number of active sessions with JBoss Wildfly?

偶尔善良 提交于 2019-12-08 06:46:15
问题 We used to query the active session count by using the following code up to JBoss 7: ObjectName name = new ObjectName(jboss.web:type=Manager,path=/MyWebApp,host=default-host); MBeanServer jboss = MBeanServerLocator.locateJBoss(); this.sessions = new Long((Integer) jboss.getAttribute(name, "activeSessions")); That no longer works with JBoss Wildfly. I can't really find the proper documentation to access the same information with the current version of JBoss AS. I've come across some links like

Can't connect to Tigase with JMX from JBOSS 7.x

為{幸葍}努か 提交于 2019-12-08 06:44:49
问题 I have a problem with connecting to Tigase with JMX from JBOSS 7.x. For connection i use next code: import java.util.Hashtable; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + HOST_NAME + ":" + PORT + "/jmxrmi"); Hashtable<String, Object> env = new Hashtable<String, Object>(); String[] credentials = new String[] {"login","pass"};

How to access dynamicmbeans from a jmx client

馋奶兔 提交于 2019-12-08 05:34:01
问题 I am writing some test cases for the JMX interface in our product. I can access attributes from standard MBeans (following sun tutorial). However, I don't seem to be able to access dynamic MBeans. The attributes are fully (readable/writable) from JConsole. JMXConnector jmxc = getJMXConnector(); // Takes care of our connection MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); ObjectName mbeanName = new ObjectName("com.xyz.prodname:type=LogManager"); // Up to this point, the logic

How to configure JMX to bind to localhost only?

坚强是说给别人听的谎言 提交于 2019-12-08 04:50:57
问题 I run Tomcat8 using JDK8 on Centos6. I enable JMX using the following options: CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9123 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=true" Unfortunately, when I check what ports are opened I discover that these ports listen to all IP: netstat -plunt | grep java Proto Recv-Q Send-Q Local Address Foreign Address

Insert MBean interceptor

五迷三道 提交于 2019-12-08 04:28:17
问题 I am working in a java project which implements MBeans and my need is to intercept MBean and change/add their properties before registry. Example : domainName:name=myMBean --> domainName:name=myMBean1,type=myType I found this link which presents how to apply an interceptor other then default interceptor but I have no idea to how do that in code. Thanks in advance. 回答1: Once you register the bean obviously it is too late. The easiest thing to do is to change how the registration is done. If

Can't connect to Tigase with JMX from JBOSS 7.x

人盡茶涼 提交于 2019-12-08 00:21:23
I have a problem with connecting to Tigase with JMX from JBOSS 7.x. For connection i use next code: import java.util.Hashtable; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; JMXServiceURL u = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" + HOST_NAME + ":" + PORT + "/jmxrmi"); Hashtable<String, Object> env = new Hashtable<String, Object>(); String[] credentials = new String[] {"login","pass"}; env.put(JMXConnector.CREDENTIALS, credentials); JMXConnector jmxConnector = JMXConnectorFactory

JMX Port dynamic allocation

允我心安 提交于 2019-12-07 07:56:43
问题 I have 16 Java processes with the same main method and arguments running on one machine. I wish to monitor these remotely thru JConsole. Hard coding port numbers like -Dcom.sun.management.jmxremote.port=5000 won't work because these processes are using same configuration and they can't work with same port. Is it possible for the JVM to select a different port dynamically for each of the 16 processes? 回答1: Using RMI Connector might be the way as you may specify URL of your agent. In case you'd

How to get memory usage of tomcat 7 using JMX API?

孤街浪徒 提交于 2019-12-07 07:10:07
问题 Is it possible to get the memory usage statistics of a tomcat server using JMX API. Which Mbean can provide me this info? I am stuck at the formation of ObjectName in the below code JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:2020/jmxrmi"); JMXConnector jmxc = JMXConnectorFactory.connect(url); MBeanServerConnection server = jmxc.getMBeanServerConnection(); Object o = jmxc.getMBeanServerConnection().getAttribute( new ObjectName("-----"); Wonder how jconsole