Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

JMXCLIENT

This is a simple utility to work with JMX from command line interface.

Requirements:

  • jshell from jdk is required.
  • management agent have to be started. Can be started on running JVM with jcmd PID ManagementAgent.start_local

Usage:

  • jshell -R-Dpid=PID -R-Dcommand=getBeans jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=getBeanInfo -R-Dbean=java.lang:type=Memory jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=getAttribute -R-Dbean=java.lang:type=Memory -R-Dmethod=HeapMemoryUsage jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=invoke -R-Dbean=java.lang:type=Memory -R-Dmethod=gc jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=dumpBeans jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=dumpBeans -R-Dbean=java.lang:* jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=dumpBeansAsJson jmxclient.jsh
  • jshell -R-Dpid=PID -R-Dcommand=dumpBeansAsJson -R-Dbean=java.lang:* jmxclient.jsh

Available options:

  • -R-Dpid=PID - java process id you want attach to
  • -R-Dcommand=help|getBeans|getBeanInfo|getAttribute|invoke|dumpBeans|dumpBeansAsJson - specify what to do
  • -R-Dbean=BEAN_PATH - full path to mbean object like: java.lang:type=Memory, supports wildcards for dumpBeans and dumpBeansAsJson
  • -R-Dmethod=METHOD_NAME - attribute or operation name
  • -R-Dargs=ARGUMENTS - additional method arguments separated by space

Commands:

  • help - show help
  • getBeans - output a list of all available MBeans
  • getBeanInfo - output all available attributes and operations for MBean
  • getAttribute - output MBean attribute value
  • invoke - run MBean operation
  • dumpBeans - dump all MBean attribute values as a flat list in beanName.attribute = value format; optionally scoped to a wildcard bean pattern
  • dumpBeansAsJson - dump all MBean attribute values as JSON; optionally scoped to a wildcard bean pattern

About

Simple tool to work with JMX from command line interface

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Contributors

Languages