How to get JMX data from Confluence using jmxterm
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
要約
Java Management Extensions (JMX) is useful to get runtime monitoring data of exposed mbeans.
Jmxterm is
... an open source command line based interactive JMX client written in Java.
It lets user access a Java MBean server in command line console without graphical environment.
In another word, it's a command line alternative of jconsole. JMXTerm relies on jconsole library at runtime though.
Using jmxterm is useful to quickly grab JMX data without the need to open a tool similar to jconsole, which requires a GUI.
ソリューション
The example below shows how to gather a specific data from a running Confluence instance. This can be used for any Java application, such as Jira.
If you don't have the
jmxterm .jar
file in the Confluence server, download it.curl -L -o jmxterm-1.0.1-uber.jar https://github.com/jiaqi/jmxterm/releases/download/v1.0.1/jmxterm-1.0.1-uber.jar
Determine the Confluence PID.
ps -ef | grep -i java
Run the following command to extract the value of a MBean.
In this example we are targeting the following attributes:
- MBean domain:java.lang
- MBean name:Code Cache
– spaces must be escaped with\\
- MBean attribute: Usageecho get -s -d java.lang -b java.lang:name=Code\\ Cache,type=MemoryPool Usage | \ java -jar jmxterm-1.0.1-uber.jar \ -l <Confluence PID> -n
関連コンテンツ
Oracle - Java Management Extensions (JMX)