jmx

How to access Spring-boot JMX remotely

喜欢而已 提交于 2019-11-26 12:07:15
问题 I know that spring automatically expose JMX beans. I was able to access it locally using VisualVM. However on prod how I can connect to remotely to the app using it\'s JMX beans? Is there a default port or should I define anything in addition? Thanks, ray. 回答1: By default JMX is automatically accessible locally, so running jconsole locally would detect all your local java apps without port exposure. To access an app via JMX remotely you have to specify an RMI Registry port. The thing to know

How do I access memory usage programmatically via JMX?

百般思念 提交于 2019-11-26 11:25:27
问题 I\'m looking for sample Java JMX code to access the values of JMX attributes from another VM. With JConsole, I have no problem looking at java.lang/Memory/Attributes/HeapMemory How would I get the same information from a Java program running in a VM? Examples of any command line options needed, or other things that need to be started appreciated. 回答1: You need to setup a JMXConnector. Here is a code snippet that will get the committed heap memory usage on a remote machine. String host =

How do you enable JMX in Websphere?

半世苍凉 提交于 2019-11-26 10:16:21
问题 I would like to use JConsole to monitor my Websphere application, but I am not sure how to enable JMX. 回答1: Following information is for Websphere 6.1 on Windows. First of all, the magic URL to connect to the MBean server is: service:jmx:iiop://<host>:<port>/jndi/JMXConnector If you have a default Websphere installation, the JNDI port number will likely be 2809, 2810, ... depending on how many servers there are installed on one system and the specific one you want to connect to. To be sure,

Connecting remote tomcat JMX instance using jConsole

此生再无相见时 提交于 2019-11-26 08:48:47
问题 I am trying to connect to a remote tomcat JMX instance using jConsole. But can\'t connect successfully. Any Idea? I included the following option in remote tomcat catalina.sh : JAVA_OPTS=\"$JAVA_OPTS -Dcom.sun.management.jmxremote \\ -Dcom.sun.management.jmxremote.port=9004 \\ -Dcom.sun.management.jmxremote.ssl=false \\ -Dcom.sun.management.jmxremote.authenticate=false\" 回答1: I had a similar, if not the same, problem. I could connect to the JMX server if I started jconsole locally on the

Why Java opens 3 ports when JMX is configured?

孤街浪徒 提交于 2019-11-26 07:25:16
问题 I run my Java program with JDK7 on Centos6. I enable JMX using the following options: JAVA_OPTS=\"${JAVA_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\" When I check what ports are opened I discover 2 additional random ports: netstat -plunt | grep java tcp 0 0 :::9123 :::* LISTEN 13295/java tcp 0 0 :::59927 :::* LISTEN 13295

Calling JMX MBean method from a shell script

偶尔善良 提交于 2019-11-26 06:13:45
问题 Are there any libraries that would allow me to call a JMX MBean method from a shell script. We expose some operations/admin commands through JMX, and we could have our admins use JConsole, or VisualVM, but some tasks are better left to automation. In that automation we\'d like to be able to call a JMX MBean method on our running server, preferably from a shell script. 回答1: The following command line JMX utilities are available: jmxterm - seems to be the most fully featured utility. cmdline

How to activate JMX on my JVM for access with jconsole?

ぃ、小莉子 提交于 2019-11-26 01:10:00
问题 How to activate JMX on a JVM for access with jconsole? 回答1: The relevant documentation can be found here: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html Start your program with following parameters: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false For instance

Apache Solr JMX服务远程代码执行漏洞复现

假装没事ソ 提交于 2019-11-25 21:42:42
##0x00 漏洞介绍 该漏洞源于默认配置文件solr.in.sh中的ENABLE_REMOTE_JMX_OPTS配置选项存在安全风险。 Apache Solr的8.1.1和8.2.0版本的自带配置文件solr.in.sh中存在ENABLE_REMOTE_JMX_OPTS="true"选项。 如果使用受影响版本中的默认solr.in.sh文件,那么将启用JMX监视并将其暴露在RMI_PORT上(默认值= 18983), 并且无需进行任何身份验证。 如果防火墙中的入站流量打开了此端口,则具有Solr节点网络访问权限的任何人都将能够访问JMX, 并且可以上传恶意代码在Solr服务器上执行。该漏洞不影响Windows系统的用户,仅影响部分版本的Linux用户。 ##0x01 影响版本 Apache Solr8.1.1和8.2.0版本 ##0x02 漏洞危害 如果受害者使用了该默认配置,则会在默认端口18983开放JMX服务,且默认未开启认证。任何可访问此端口的攻击者可利用此漏洞向受影响服务发起攻击,执行任意代码。 ##0x03 准备工作 1) 搭建环境 安装Apache Solr 8.20 wget https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/8.2.0/solr-8.2.0.zip 2) 启动环境 ##0x04