jmx4r 0.0.3 has just been released.
jmx4r is a JRuby library which makes it super easy to write simple Ruby scripts to manage Java applications using JMX.
Two new features in this release:
- some much-needed documentation
- as requested by Brian McCallister, I’ve modified the code so that it is now possible to write a script to manage many Java applications at the same time.
For example, the script to trigger a garbage collection on a cluster of Java applications at the same time (quite a bad idea but a simple one):
port = 1090
hosts = ["node1", "node2", "node3", "node4"]
hosts.each do |h|
memory = JMX::MBean.find_by_name "java.lang:type=Memory", :host => h, :port => port
memory.gc
end
Quite simple, isn’t it?
