Percona JMX Monitoring Template for Cacti

These templates use ss_get_by_ssh.php to connect to a server via SSH and extract statistics from the JMX server.


Once the SSH connection is working, you need to make the Java runtime information available through JMX by adding the JMX system properties when you start the program you want to monitor. For a normal Java program, you can learn more about this from

Monitoring and Management Using JMX. If you are using Tomcat, you can read Monitoring and Managing Tomcat. A simple example of how to start Notepad.jar with JMX instrumentation follows:

java -jar \ \ \
-Dcom.sun.magement.jmxremote.authenticate=false \

Now you need to install ant and the XML file with the JMX definitions. Copy misc/jmx-monitor.xml to the monitoring user’s $HOME directory on the server you want to monitor. Then download catalina-ant-jmx.jar, which is part of Tomcat, to the $HOME/.ant/lib directory.

Before you test the Cacti script’s functionality, test that the instrumentation is available to JMX. Run the following command on the host you want to monitor, from the Cacti user’s home directory. Replace any values as needed:

ant -Djmx.server.port=9012 -e -q -f jmx-monitor.xml

Now on the Cacti host, test a command similar to the following, replacing any values necessary with ones appropriate for your environment:

sudo -u cacti php /usr/share/cacti/scripts/ss_get_by_ssh.php --type jmx --host --items lt,lu

Sample Graphs

The following sample graphs demonstrate how the data is presented.


The file descriptors used by the JMX process.


The heap memory usage used by the JMX process.


The non-heap memory usage used by the JMX process.

Table Of Contents

Previous topic

Percona Apache Monitoring Template for Cacti

Next topic

Percona Linux Monitoring Template for Cacti

Contact Us

For free technical help, visit the Percona Community Forum.
To report bugs or submit feature requests, open a JIRA ticket.
For paid support and managed or professional services, contact Percona Sales.