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.

Installation

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.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9012 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.magement.jmxremote.authenticate=false \
/path/to/Notepad.jar

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 127.0.0.1 --items lt,lu

Sample Graphs

The following sample graphs demonstrate how the data is presented.

../_images/jmx-file-descriptor.png

The file descriptors used by the JMX process.

../_images/jmx-heap-memory-usage.png

The heap memory usage used by the JMX process.

../_images/jmx-nonheap-memory-usage.png

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

Percona Monitoring Plugins
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

Percona Apache Monitoring Template for Cacti

Next topic

Percona Linux Monitoring Template for Cacti



© Copyright 2012, Percona Inc.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
{@ footer_documentation_bugs @}
This documentation is developed in Launchpad as part of the Percona Monitoring Plugins source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
{@ /footer_documentation_bugs @} ]]>