jmx

How to programmatically check JMX MBean operations and attributes?

最后都变了- 提交于 2019-12-30 00:42:13
问题 Suppose we have a MBean that has the following attributes and operations. Attributes: name size Operations: getName() getSize() Is there a way to programmatically check for the attributes and operations? I've been working with the IBM WebSphere MBeans and their documentation isn't very good. For example, if you go to IBMs Infocenter and navigate to Network Deployment -> Reference -> Programming interfaces -> Mbean interfaces -> ThreadPool. They only have attributes listed and no operations.

zabbix 基于JMX的Tomcat监控

喜夏-厌秋 提交于 2019-12-29 03:52:22
一、环境   ubuntu14.04 LTS   Java 1.7.0   zabbix 2.4.5 二、安装配置    1、安装JavaGateway   在ubuntu14.04LTS下因为直接使用的是 zabbix-release_2.4-1+trusty_all.deb 包安装的zabbix, sudo apt-get install zabbix-server-mysql zabbix-frontend-php 所以要实现jmx只需要安装一个zabbix-java-gateway的包即可 sudo apt-get install zabbix-java-gateway   如果是直接源码编译zabbix-2.4.5,只需要 ./configure --enable-java --prefix=/usr/local/zabbix/zabbix_java sudo make && sudo make install    2、配置zabbix_java_gateway.conf cd /etc/zabbix sudo vim zabbix_java_gateway.conf 添加: LISTEN_IP="0.0.0.0" LISTEN_PORT=10052 PID_FILE="/tmp/zabbix_java.pid" START_POLLERS=5   其中 LISTEN

zabbix使用jmx监控tomcat

本小妞迷上赌 提交于 2019-12-29 03:50:43
监控原理:当Zabbix-Server需要知道java应用程序的某项性能的时候,会启动自身的一个Zabbix-JavaPollers进程去连接Zabbix-JavaGateway请求数据,而ZabbixJavagateway收到请求后使用"JMXmanagementAPI"去查询特定的应用程序,而前提是应用程序这端在开启时需要"-Dcom.sun.management.jmxremote"参数来开启JMX远程查询就行。Java程序会启动自身的一个简单的小程序端口12345向Zabbix-JavaGateway提供请求数据。 从上面的原理图中可以看出,配置Zabbix监控Java应用程序的关键点在于:配置Zabbix-JavaGateway、让Zabbix-Server能够连接Zabbix-JavaGateway、Tomcat开启JVM远程监控功能等 1、zabbix server安装Zabbix-Java-gateway Java-gateway不安装在zabbix-server上也可以,仅仅是作为一个采集器! [root@zabbix ~]# yum install -y zabbix-java-gateway [root@zabbix ~]# java -version openjdk version "1.8.0_171" OpenJDK Runtime

在k8s集群中,利用prometheus的jmx_exporter进行tomcat的JVM性能监控,并用grafana作前端展示

↘锁芯ラ 提交于 2019-12-29 01:41:28
查找了很多文档,没有完全达到我要求的, 于是,作了一定的调整,成现在这样。 操作步骤如下: 一,准备好两个文件。 jmx_prometheus_javaagent-0.3.1.jar jmx_exporter.yml jmx_exporter.yml作最简单配置如下: --- rules: - pattern: ".*" 二,tomcat的启动项,一直在bin下单独的setenv.sh里操作,新增如下启动选项,将jar包及yaml加入启动选项。 JAVA_OPTS="$JAVA_OPTS -javaagent:/xxx/bin/jmx_prometheus_javaagent-0.3.1.jar=1234:/xxx/bin/jmx_exporter.yml" 三,制作dockerfile时,要将这两个东东也CP到上面指定目录,并EXPOSE一个新的端口。 ... COPY --chown=a:a tomcat /xxx/tomcat COPY --chown=a:a jdk /xxx/jdk COPY --chown=a:a jmx_prometheus_javaagent-0.3.1.jar /xxx/tomcat/bin/ COPY --chown=a:a jmx_exporter.yml /xxx/tomcat/bin/ WORKDIR ${CATALINA_HOME}

java.exe重命名之后无法被 jvisualvm、jconsole监控的问题

孤街醉人 提交于 2019-12-27 17:54:30
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在windows上面跑java进程,为了注册windows service服务,把java.exe 改成了自己的 haha.exe 突然有一天想用jvisualvm、jconsole查看线程、内存的情况,发现默认的process list里面没有我的haha.exe,而任务管理器里面是有的。 找到一篇 java进程运行时候添加 JMX连接参数 -Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false 再一看,已经有了 感谢 http://stackoverflow.com/questions/5031359/jvisualvm-doesnt-list-certain-java-processes 来源: oschina 链接: https://my.oschina.net/u/588574/blog/523949

Has anyone ever got a remote JMX JConsole to work?

巧了我就是萌 提交于 2019-12-27 11:01:51
问题 It seems that I've never got this to work in the past. Currently, I KNOW it doesn't work. But we start up our Java process: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6002 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false I can telnet to the port, and "something is there" (that is, if I don't start the process, nothing answers, but if I do, it does), but I can not get JConsole to work filling in the IP and port. Seems like it

Tomcat开启JMX监控

拜拜、爱过 提交于 2019-12-26 17:13:25
搭建模拟环境: 操作系统:centos7内存:1Gjdk:1.8.0_131tomcat:8.0.48 环境准备我们这里就不直接演示了,直接配置tomcat的jmx     1、进入到tomcat的bin目录下       # cd /opt/tomcat/apache-tomcat-8.0.48/bin/     2、编辑配置文件       # vim catalina.sh     3、在下图中上面添加参数            参数添加后的样子       3.1、此配置连接jmx不需要账号密码:    CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=192.168.100.117 -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"       配置后的截图:             参数说明:        hostname:是监控tomcat所在服务器的ip地址       jmxremote.port:端口号,是要开启的监控端口号

tomcat打开远程调试和jmx远程监控

谁都会走 提交于 2019-12-25 16:19:29
远程Debug打开   在catalina.sh中去掉CATALINA_OPTS="$CATALINA_OPTS "-server" "-Xdebug" "-Xnoagent" "-Djava.compiler=NONE" "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12345的注释,重启后生效。 远程jvm监控    在setenv.sh中加入CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname=10.171.113.244 -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.rmi.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false",在setenv.sh里面写是为了不影响catalina.sh本身结构,重启后生效,通过jconsole连接时需要填写tomcat所属用户的用户名,不需要填写密码。 来源: https://www.cnblogs.com/masterhuang/p/9776666.html

Getting exception while refreshing Spring ApplicationContext in Spring Boot application

孤街浪徒 提交于 2019-12-25 07:00:42
问题 We are using Spring Boot for our application. After starting the application, in the runtime we are adding(loading) a new Bean to the existing Applicationcontext. AnnotationConfigApplicationContext appContext = new AnnotationConfigApplicationContext(); appContext.register(NewBean.class); appContext.refresh(); after adding the bean we are doing a refresh of applicationContext During the refresh the MBean is trying to reregister some endpoints and we are getting the following error (getting

Alert Management Threshold with Monitoring for Kafka/Confluent JMX metrics

强颜欢笑 提交于 2019-12-25 03:27:31
问题 I am building an Alert Monitoring tool for Kafka. I do understand that there can be metrics for which the thresholds depends on application data. But I am only interested in knowing those metrics and threshold values which will help me in knowing the lag and help in determining if any scaling is required. As of now I can do following : Enable JMX on Kafka Broker Fecth JMX metrics using JMX Java client or jCOnsole. Next I researched and found so many metrics but none had comnplete thresholds