jmx

Connecting to JMX server in spring throws exception!

一笑奈何 提交于 2019-12-04 05:00:48
So when I try to connect to jmx from jconsole I get this exception: Caused by: java.rmi.ConnectException: Connection refused to host: 78.84.17.116; nested exception is: java.net.ConnectException: Connection timed out: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198) ... I was trying to connect to such url in jconsole: service:jmx:rmi:///jndi/rmi://78.84.17.116:43030/test My jmx spring configuration: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema

Java应用监控利器JMX

左心房为你撑大大i 提交于 2019-12-04 04:45:58
啥是 JMX? The Java Management Extensions (JMX) API is a standard API for management and monitoring of resources such as applications, devices, services, and the Java virtual machine. The JMX technology was developed through the Java Community Process (JCP) as Java Specification Request (JSR) 3, Java Management Extensions, and JSR 160, JMX Remote API.——摘自官网定义。 其实约莫能够认识到,JMX 是 Java 管理扩展,主要用于管理和监视诸如应用程序、设备、服务和 Java 虚拟机等资源的标准 API。JMX技术是通过 JCP 制定开发,由 JSR 3 和 JSR 160 规范定义而成。 稍微科普一下知识点。 JCP:是 Java Community Process 的缩写,是一个主要由Java开发者以及被授权者组成的开放的国际组织,职能是开发和修订 Java 技术规范。 JSR:是 Java Specification Requests

Is it possible to programmatically close a Java process through JMX

不打扰是莪最后的温柔 提交于 2019-12-04 04:35:46
I'm currently writing an app to monitor another Java process and take specific actions when certain targets are hit. For example, if a thread deadlocks for a certain time, kill the thread, if the memory usage goes over a specific amount, send email alerts and kill the process, etc. My app will run as a stand-alone app, monitoring specific other apps (locally, though from what I can see remote or local makes no difference here). I'm monitoring the external JVMs via MXBeans, but cannot see a clean way to kill the external process short of a system call like 'kill -9 ' (I'm working in UNIX by the

LINUX配置JMX监控tomcat7情况

我怕爱的太早我们不能终老 提交于 2019-12-04 04:06:52
首先谢谢@逝水fox大神,谢谢他给我讲JMX帮我配置JMX 现在将JMX在LINUX的配置分享给大家,希望对大家有用 代码为@逝水fox整理 1) 正常安装JDK和Tomcat 配置环境变量(此步略过) 2) 配置JMX访问文件 # cd $CATALINA_HOME/conf/ # cp $JAVA_HOME/jre/lib/management/jmxremote.password.template jmxremote.password # chmod 700 jmxremote.password (一定注意这个文件默认是不可写的) # vi $CATALINA_HOME/conf/jmxremote.password 在最下面添加一个用户(第一个是用户名 第二个是密码) fox 123456 # chmod 400 jmxremote.password (要求该文件是任何用户均不可写的) # cp $JAVA_HOME/jre/lib/management/jmxremote.access jmxremote.access # vi jmxremote.access (该文件是对jmx用户的授权) 到最后一行 将 monitorRole readonly controlRole readwrite 注释 更改为 # monitorRole readonly #

Port MBean from JBoss 4.x to JBoss 7

梦想的初衷 提交于 2019-12-04 01:51:27
we're currently in the process of porting some of our projects from JBoss 4.x to JBoss 7. So far everything seems to work fine, except for our MBeans, which we're commonly using to provide simple management operations. I've been searching for quite a while now, but either I'm incapable of comming up with the correct search term or I'm missing some piece of knowledge to bridge the gap between MBean definition in JBoss 4.x and JBoss 7. Thus, hopefully someone can provide a hint on what I might be missing or where I'd have to read on (maybe some documentation, examples etc.) In Jboss 4.x our

How to retrieve Weblogic's Deployment test points through Weblogic Java API

断了今生、忘了曾经 提交于 2019-12-04 00:50:58
I'm working on a Weblogic health monitoring code base, which is based on JMX. I am trying to get the list of all deployment test points (the http addresses, as shown in the following snapshot), and see if that web address is reachable or not. Is there a way to access the list of these test points in Weblogic's Java API? They are under [server_name] --> deployment (left menu) --> [app name] --> Testing pane, under " Deployment Tests " table. There is no direct method call to generate test urls. but from wlst or mbeans you can gather information about server url port and application context. and

zabbix系列zabbix3.4监控zookeeper3.4.10

…衆ロ難τιáo~ 提交于 2019-12-03 23:50:49
监控zookeeper来自网上,大家一搜就可搜到了,只是zabbix版本和zookeeper有点出入,自行修改一下就可以了。 zookeeper监控要点 系统监控 这个监控linux系统以及修改linux服务器参数即可 内存使用量 ZooKeeper应当完全运行在内存中,不能使用到SWAP。Java Heap大小不能超过可用内存。 Swap使用量 使用Swap会降低ZooKeeper的性能,设置vm.swappiness = 0 网络带宽占用 如果发现ZooKeeper性能降低关注下网络带宽占用情况和丢包情况,通常情况下ZooKeeper是20%写入80%读入 磁盘使用量 ZooKeeper数据目录使用情况需要注意 磁盘I/O ZooKeeper的磁盘写入是异步的,所以不会存在很大的I/O请求,如果ZooKeeper和其他I/O密集型服务公用应该关注下磁盘I/O情况 ZooKeeper监控 zk_avg/min/max_latency 响应一个客户端请求的时间,建议这个时间大于10个Tick就报警 平均延迟/最小延迟/最大延迟 zk_outstanding_requests 排队请求的数量,当ZooKeeper超过了它的处理能力时,这个值会增大,建议设置报警阀值为10 堆积请求数 zk_packets_received 接收到客户端请求的包数量 收包数 zk_packets

Cannot integrate JMX with Spring application

早过忘川 提交于 2019-12-03 22:23:23
问题 I have got a SPRING application. When I run mvn jetty:run everything is ok. I would like to use JMX in my project. I created another project, I tried tutorial for beginners and I was able to see some changes with jconsole . Now, I want to use JMX in my real project and I would like to use SPRING libraries which manages JMX - following this post How to integrate JMX with Spring? I have got a class: public class MyMainClass { private int var1; private int var2; private TimeUnit var3; // public

How to connect to a local JMX server by knowing the process id?

北城余情 提交于 2019-12-03 21:31:56
The motivation behind this is to manage local java services, using JMX, without something more heavyweight like the java service Wrapper. Each service is started with -Dcom.sun.management.jmxremote which means that "The JVM is configured to work as a local (same-machine-only) JMX server." (see here for a good explaination). I tried the Attach API , but decided against it since it is not bundled with Java SE6 and and integrating it with maven was not possible. @Tim Büthe If ConnectorAddressLink.importFrom returns null, try loading management-agent.jar into VM. For example with something like

使用JMX透过防火墙远程监控tomcat服务

允我心安 提交于 2019-12-03 18:44:25
JDK的bin目录下有jvisualvm或jconsole可以监控本地和远程jvm实例的运行动态(包括cpu,内存等), 对于性能分析或内存泄露分析等极其方便。下面介绍如何通过这两个工具远程监控有防火墙的linux上的tomcat服务。 废话少说,直接上正题: 我的测试环境是:centos 6.2(IP为192.168.1.118)上通过jsvc将tomcat 7作为服务启动。 1. 下载http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-7/v7.0.28/bin/extras/catalina-jmx-remote.jar并放在tomcat7的$CATALINA_BASE/lib目录。 2. 修改tomcat7的$CATALINA_BASE/conf/server.xml,在<Server port="8005" shutdown="SHUTDOWN"> 下加入监听器: <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" /> 3. 建立文本文件$CATALINA_BASE/conf/jmxremote