Domanda

I would like to monitor JMX applictions via the command line between 2 centos boxes, ideally as part of a python (jython?) script so it can be automated

I've looked at applications like jmxterm, jmxbox and nagios-jmx but the problem I have is it doesn't seem to work! Each jar just sits there trying to connect and I just close it because nothing seems to happen

I've setup a vanilla tomcat5 which is listening to jmx via the following runtime options

-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=7009         
-Dcom.sun.management.jmxremote.ssl=false         
-Dcom.sun.management.jmxremote.authenticate=true 
-Djava.rmi.server.hostname=IP_ADDRESS 
-Dcom.sun.management.jmxremote.password.file=/etc/tomcat5/jmxremote.password 
-Dcom.sun.management.jmxremote.access.file=/etc/tomcat5/jmxremote.access
-Dcom.sun.management.jmxremote.local.only=false 

I've checked to ensure tomcat is listening on the ports I have set and I have also checked I can telnet between the 2 boxes and all firewalls are off and have managed to connect via jconsole (from a windows machine) which outputs data and graphs so it looks like everything is working.

Can anyone show me how to monitor tomcat JMX via the command line?

È stato utile?

Soluzione

For anyone interested in how I achieved this, I used command line jmx and a custom python script using popen to query the beans http://crawler.archive.org/cmdline-jmxclient/

p.s I also got caught out by the jmx random port selector problem!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top