title: Simple way to programmatically access JMX console
body: <p>I've got a java application deployed to a Jetty container, and I want to access its jmx MBeans through a shell script.  I am trying to tie Nagios monitoring to the values contained within the MBeans and also periodically run MBean operations.</p>
  
  <p>I've looked into jmx4perl because it has a script specifically created for hooking up Nagios and jmx, but I'm turned off to the product because of all the perl packages you have to install and the extra war you have to deploy to the web container.  Additionally, I'm not very familiar with perl, and I wouldn't know how to execute an MBean operation.  I've written many scripts to hook into Nagios monitoring, so I don't mind writing code for this part.</p>
  
  <p>What is a simple way (few dependencies, and not a lot of code required) to accomplish this?  I keep thinking that the JMX console should be simple.  All I want to do is get values for keys and run an operation with no parameters.</p>