Monitoring AEM via JConsole
Updated: May 6
Sometimes, the Out of the Box (OOTB) monitoring that comes with AEM is not enough and we need a better way to monitor our AEM instances. AEM allows external monitoring applications to interact with Managed Beans (MBeans) via Java Management Extensions (JMX). Using applications such as JConsole or other enterprise-level monitoring applications, users can monitor these MBeans objects as well as performance and resource usages of AEM.
Some of the registered MBeans that can be monitored via JMX:
System resources such as memory, threads and classes can also be monitored via these monitoring applications.
The ideal solution is to have an enterprise level monitoring in placed but the next best thing is to use a local tool such as JConsole to give us some insights on what a proper monitoring strategy can look like. This is a simple instruction of getting using JConsole to quickly monitor AEM and for this proof of concept (POC), we are going to use a local running AEM Author instance.
1. Install a local copy of JConsole (we're assuming that you already have JAVA installed). Follow the instructions on this page to have the tool downloaded and installed:
2. For this monitoring POC to work, we need a default local installation of AEM Author listening to port 4502. We also need to start AEM to listen to port 9091 for the JMX agent.
Add the following as part of the start-up for your AEM instance:
-Dcom.sun.management.jmxremote.port=9091 \ -Dcom.sun.management.jmxremote.rmi.port=9091 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote \ -Djava.rmi.server.hostname=localhost
This added start-up parameters will need to be added to your start script (/crx-quickstart/bin/start). It would be similar to the image below:
3. Once AEM is running, start JConsole by typing "jconsole" in the command prompt.
4. Enter the following information into JConsole:
JConsole will provide you with information from performance to resourcing of the Java Virtual Machine (JVM) as well as very specific AEM MBean processes.
The following screens can provide us with information on memory, thread, classes and system overview of the JVM:
The following screens can provide us with MBean information. This screen provides us with information on the Publish Replication Agent. This can show very quickly if the agent is enabled, valid, is blocked and if there is a queue of items to be published:
The following screen shows real-time heap memory usage of AEM: