How to run JMX monitoring (e.g.: jconsole, jvisualvm) over ssh tunnel?

Skip to first unread message

Tim Olsen

Oct 7, 2012, 8:03:15 AM10/7/12

I switched from Trinidad to  justTomcat a few weeks ago so I could follow instructions I found for enabling JMX monitoring through an SSH tunnel in order to troubleshoot performance problems.  Namely, I added the following xml tag to tomcat's server.xml:

  <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
            useLocalPorts="true" rmiRegistryPortPlatform="JMX_PORT_1"

where JMX_PORT_1 and JMX_PORT_2 are the ports I forward over ssh.

I also made sure catalina-jmx-remote.jar was in tomcat's lib folder.

I've fixed my app's performance problems and would like to switch back to Trinidad, but I would like to keep the JMX monitoring.  How can I add JMX monitoring to trinidad so that it is easy to use over ssh tunnel?  Is it easy to add the equivalent Listener and catalina-jmx-remote.jar to trinidad?  

I took a look at trinidad_lifecycle_extension but I received no response on an issue I opened a few weeks ago asking how to set useLocalPorts on the JmxRemoteLifeCycleListener: .  I suspect  trinidad_lifecycle_extension is inactive as it hasn't seen a commit in 2 years.

Any help would be greatly appreciated.  It would be great to be back on Trinidad!



Oct 8, 2012, 5:46:03 AM10/8/12
 Hi Tim, sorry about that.

I've seen the issue but forgot about it later due a few others (and maybe hoped you'll figure it out :)).
First of all the lifecycle extension was not compatible with the latest Trinidad (although in your case you wouldn't probably notice since you only need a server listener) but now 0.3 is.

I've added an "untested" quick sample to the comment, hope it's understandable ...

Cheeers, K.

Tim Olsen

Oct 8, 2012, 10:22:44 AM10/8/12
Awesome!  Thanks Karol!  I'll try it out.


Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para ver este debate en la Web, visita
Para publicar una entrada en este grupo, envía un correo electrónico a
Para anular tu suscripción a este grupo, envía un correo electrónico a
Para tener acceso a más opciones, visita el grupo en

Ricardo Wolosker

Nov 4, 2014, 11:31:54 AM11/4/14
é incrível como que ninguém sabe / consegue responder essa merda.
Reply all
Reply to author
0 new messages