cloudbees-jmx-invoker

CloudBees JMX Invoker tools

License

License

GroupId

GroupId

com.cloudbees
ArtifactId

ArtifactId

cloudbees-jmx-invoker
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

cloudbees-jmx-invoker
CloudBees JMX Invoker tools

Download cloudbees-jmx-invoker

How to add to project

<!-- https://jarcasting.com/artifacts/com.cloudbees/cloudbees-jmx-invoker/ -->
<dependency>
    <groupId>com.cloudbees</groupId>
    <artifactId>cloudbees-jmx-invoker</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.cloudbees/cloudbees-jmx-invoker/
implementation 'com.cloudbees:cloudbees-jmx-invoker:1.0.2'
// https://jarcasting.com/artifacts/com.cloudbees/cloudbees-jmx-invoker/
implementation ("com.cloudbees:cloudbees-jmx-invoker:1.0.2")
'com.cloudbees:cloudbees-jmx-invoker:jar:1.0.2'
<dependency org="com.cloudbees" name="cloudbees-jmx-invoker" rev="1.0.2">
  <artifact name="cloudbees-jmx-invoker" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.cloudbees', module='cloudbees-jmx-invoker', version='1.0.2')
)
libraryDependencies += "com.cloudbees" % "cloudbees-jmx-invoker" % "1.0.2"
[com.cloudbees/cloudbees-jmx-invoker "1.0.2"]

Dependencies

compile (5)

Group / Artifact Type Version
args4j : args4j jar 2.0.24
org.slf4j : slf4j-api jar 1.7.5
org.slf4j : slf4j-simple jar 1.7.5
com.google.code.findbugs : jsr305 Optional jar 2.0.1
org.hamcrest : hamcrest-library jar 1.3

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

system (1)

Group / Artifact Type Version
com.sun » tools jar 1.6.0

Project Modules

There are no modules declared in this project.

CloudBees JMX Invoker

Small script to perform the following JMX operations on a Java process running locally:

  • list mbeans
  • describe a mbean
  • invoke a JMX operation
  • read or write a JMX attribute

JMX Invoker parameters

 --pid-file PID_FILE                    : PID FILE of the JVM to attach to.
                                          --pid or --pid-file required
 -attr (--attribute) ATTRIBUTE_NAME     : attribute to read or to update. If a
 [VAL]                                  : VAL is passed, then it is a write
                                          action, otherwise, it is a read action
 -d (--describe-mbeans)                 : describe mbeans
 -h (--help)                            : print help
 -l (--list-mbeans)                     : list mbeans
 -on (--object-name) OBJECT_NAME        : ObjectName of the MBean(s) to invoke,
                                          can contain wildcards (*). If more
                                          than one MBean match, all MBeans are
                                          invoked
 -op (--operation) OPERATION_NAME       : operation to invoke with arguments
 [ARG1 [ARG2  ...]]                     :
 -p (--pid) PID                         : PID of the JVM to attach to. --pid or
                                          --pid-file required
 -v (-x, --verbose)                     : print debug info
 -vvv (-xxx)                            : print super verbose debug info

Samples

List MBeans

java \
   -cp $JAVA_HOME/lib/tools.jar:target/cloudbees-jmx-invoker-1.0.1-jar-with-dependencies.jar \
   com.cloudbees.jmx.JmxInvoker \
   -vvv -p 11172 \
   -on Catalina:type=DataSource,class=javax.sql.DataSource,* \
   -l

Describe MBean

java \
   -cp $JAVA_HOME/lib/tools.jar:target/cloudbees-jmx-invoker-1.0.1-jar-with-dependencies.jar \
   com.cloudbees.jmx.JmxInvoker \
   -vvv -p 11172 \
   -on java.util.logging:type=Logging \
   -d

Read JMX attribute: DataSource numActive

java \
   -cp $JAVA_HOME/lib/tools.jar:target/cloudbees-jmx-invoker-1.0.1-jar-with-dependencies.jar \
   com.cloudbees.jmx.JmxInvoker \
   -vvv -p 11172 \
   -on Catalina:type=DataSource,class=javax.sql.DataSource,name="jdbc/petclinic" \
   -attr numActive

Invoke JMX operation : get LogBack log level

java \
   -cp $JAVA_HOME/lib/tools.jar:target/cloudbees-jmx-invoker-1.0.1-jar-with-dependencies.jar \
   com.cloudbees.jmx.JmxInvoker \
   -v -p 11172 \
   -on "ch.qos.logback.classic:Name=cocktail-app,Type=ch.qos.logback.classic.jmx.JMXConfigurator" \
   -op getLoggerLevel org.jmxtrans

Invoke JMX operation : set LogBack log level

java \
   -cp $JAVA_HOME/lib/tools.jar:target/cloudbees-jmx-invoker-1.0.1-jar-with-dependencies.jar \
   com.cloudbees.jmx.JmxInvoker \
   -v -p 11172 \
   -on "ch.qos.logback.classic:Name=cocktail-app,Type=ch.qos.logback.classic.jmx.JMXConfigurator" \
   -op setLoggerLevel org.jmxtrans DEBUG

com.cloudbees

CloudBees Community

Versions

Version
1.0.2
1.0.1
1.0.0