jmesnil / jmx4r

a JMX library for JRuby
http://github.com/jmesnil/jmx4r/
Apache License 2.0
68 stars 13 forks source link

jmx4r[http://github.com/jmesnil/jmx4r/] is a JMX library for JRuby.

It can be used to write simple Ruby scripts running on JRuby[http://jruby.org] to manage remote Java applications (e.g. JBoss[http://www.jboss.org], Tomcat[http://tomcat.apache.org/]) using JMX[http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/].

jmx4r helps to manage Java applications using JMX in a simple and powerful way:

== Installation

jruby -S gem install jmx4r

== Usage

To trigger a garbage collection on a Java application:

require 'rubygems' require 'jmx4r'

JMX::MBean.establish_connection :host => "localhost", :port => 3000

memory = JMX::MBean.find_by_name "java.lang:type=Memory"

display verbose GC logs

memory.verbose = true

trigger a Garbage Collection

memory.gc

For local processes not publishing jmxrmi ports, instead:

connect to the local JConsole process

JMX::MBean.establish_connection :command => /jconsole/i

== Help

== Source Code

git clone git://github.com/jmesnil/jmx4r.git