jmx

Java app performance counters viewed in Perfmon

那年仲夏 提交于 2019-12-01 17:29:06
问题 I have a Java app running on Tomcat, and I would like to monitor counters using Windows Performance Monitor. Is this possible using a JMX adapter for the Java MBeans or by some other means? 回答1: Since you tagged this with JMX and MBeans, I assume your counters are accessible from a Java MBean. If so you could use jconsole, provided with the Java SDK, to monitor the counters. Once you find your MBean in the MBeans tab, double click on the value and it will draw a nice line graph for easy

JMX脚本再某些机器上报错,有的运行超时

本小妞迷上赌 提交于 2019-12-01 13:43:17
运行超时的 是因为在server端运行命令执行脚本,是server给agent下达的指定,但是server端到agent的10050端口没开,所以或一致堵死在那,知道执行超时, 解决:开通server端到agent的10050端口。 运行报错,提示错误的语法 正常jmx脚本跑在py2.6的机器上,报错的那两台机器是2.4的版本 可能是因为解释器版本的不同导致的语法解析错误,对于2.4的版本重新更改脚本。 来源: https://www.cnblogs.com/0916m/p/11688912.html

【JMX】jmx结合jmx_exporter实现promethues监控

坚强是说给别人听的谎言 提交于 2019-12-01 12:51:45
JMX JMX的全称为Java Management Extensions. 顾名思义,是管理Java的一种扩展。这种机制可以方便的管理、监控正在运行中的Java程序。常用于管理线程,内存,日志Level,服务重启,系统环境等 基本术语 MBean: 是Managed Bean的简称,可以翻译为“管理构件”。在JMX中MBean代表一个被管理的资源实例,通过MBean中暴露的方法和属性,外界可以获取被管理的资源的状态和操纵MBean的行为。事实上,MBean就是一个Java Object,同JavaBean模型一样,外界使用自醒和反射来获取Object的值和调用Object的方法,只是MBean更为复杂和高级一些。MBean通过公共方法以及遵从特定的设计模式封装了属性和操作,以便暴露给管理应用程序。例如,一个只读属性在管理构件中只有Get方法,既有Get又有Set方法表示是一个可读写的属性。一共有四种类型的MBean: Standard MBean, Dynamic MBean, Open MBean, Model MBean。 MBeanServer: MBean生存在一个MBeanServer中。MBeanServer管理这些MBean,并且代理外界对它们的访问。并且MBeanServer提供了一种注册机制,是的外界可以通过名字来得到相应的MBean实例。 JMX Agent:

Cannot connect to Tomcat's MBeanServer via jconsole in Java6

痞子三分冷 提交于 2019-12-01 11:19:09
I'm on a vista machine. I've started tomcat 5.5.27 with these options: CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=9003 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false" When I connect via jconsole and added the following service url service:jmx:rmi:///jndi/rmi://localhost:9003/jmxrmi it would not connect. Any ideas ? On Ubuntu 10.04, using OpenJDK 6 and Tomcat 6.0.29, I was unable to activate JMX for a local jconsole session, no matter how many com.sun.management.jmxremote.* options I passed to java with CATALINA_OPTS. The problem was the

How to monitor Kafka broker using jmxtrans?

£可爱£侵袭症+ 提交于 2019-12-01 11:18:10
Kafka 0.8.1.1 (kafka_2.8.0-0.8.1.1.tgz) I am using jmxtrans to do JMX monitoring of a Kafka instance (which is running in docker). Unfortunately, kafka metrics are not being returned. I have tried a few things to debug this and know that kafka is running correctly (I can produce/consume messages successfully) have concluded that jmxtrans does return JMX metrics (for example, java.lang:type=Memory, attribute=HeapMemoryUsage returns correct data) so the general kafka and JMX capability seems to be working. Also, I can access the metrics when I use jconsole -- the metrics seem to be captured with

How to stop message processing before undeploying?

这一生的挚爱 提交于 2019-12-01 11:18:06
Given: A JMS message queue. A timer service which puts messages to that queue periodically (from a database). A JEE6 message-driven bean which reads from the queue. The timer service and the message-driven bean are part of different deployment units. Problem: The message-driven bean cannot be undeployed, without breaking the workflow state, as long as messages are work in process. Because of that, we stop the timer service first and wait until all messages are finished. Is there a way to automate that behavior? Or is it possible to prevent undeployment if the timer service is still running? We

How to get a MBean binding class instance

心已入冬 提交于 2019-12-01 10:47:47
I am trying to get the instance of a service class bound in jboss-service.xml using MBean. JBoss-Service.xml has defined a BasicThreadPool which we want to use it in our code. This is what it is in JBOSS-Service.xml . <mbean code="org.jboss.util.threadpool.BasicThreadPool" name="jboss.system:service=ThreadPool"> <attribute name="Name">JBoss System Threads</attribute> <attribute name="ThreadGroupName">System Threads</attribute> <attribute name="KeepAliveTime">60000</attribute> <attribute name="MaximumPoolSize">10</attribute> <attribute name="MaximumQueueSize">1000</attribute> <!-- The behavior

How to monitor Kafka broker using jmxtrans?

本秂侑毒 提交于 2019-12-01 09:57:26
问题 Kafka 0.8.1.1 (kafka_2.8.0-0.8.1.1.tgz) I am using jmxtrans to do JMX monitoring of a Kafka instance (which is running in docker). Unfortunately, kafka metrics are not being returned. I have tried a few things to debug this and know that kafka is running correctly (I can produce/consume messages successfully) have concluded that jmxtrans does return JMX metrics (for example, java.lang:type=Memory, attribute=HeapMemoryUsage returns correct data) so the general kafka and JMX capability seems to

Cannot connect to Tomcat's MBeanServer via jconsole in Java6

ぃ、小莉子 提交于 2019-12-01 09:37:21
问题 I'm on a vista machine. I've started tomcat 5.5.27 with these options: CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=9003 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false" When I connect via jconsole and added the following service url service:jmx:rmi:///jndi/rmi://localhost:9003/jmxrmi it would not connect. Any ideas ? 回答1: On Ubuntu 10.04, using OpenJDK 6 and Tomcat 6.0.29, I was unable to activate JMX for a local jconsole session, no

How to stop message processing before undeploying?

风流意气都作罢 提交于 2019-12-01 08:53:41
问题 Given: A JMS message queue. A timer service which puts messages to that queue periodically (from a database). A JEE6 message-driven bean which reads from the queue. The timer service and the message-driven bean are part of different deployment units. Problem: The message-driven bean cannot be undeployed, without breaking the workflow state, as long as messages are work in process. Because of that, we stop the timer service first and wait until all messages are finished. Is there a way to