Today I compile several tips about enabling and getting JMX information in Alfresco ECM.
1. Enabling JMX in Alfresco Enterprise
For enabling JMX in Alfresco Enterprise, check the documentation of your Alfresco version:
The service URL is:
2. Enabling JMX in Alfresco Community
First, just remember that Alfresco JMX objects are not available in Alfresco Community, but useful information may be used from java, tomcat or operating system JMX objects available. For enabling JMX, we need to add these properties in setenv.sh
CATALINA_OPTS="-Dcom.sun.management.jmxremote $CATALINA_OPTS "
CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=9999 $CATALINA_OPTS "
CATALINA_OPTS="-Dcom.sun.management.jmxremote.ssl=false $CATALINA_OPTS "
CATALINA_OPTS="-Dcom.sun.management.jmxremote.authenticate=true $CATALINA_OPTS "
CATALINA_OPTS="-Dcom.sun.management.jmxremote.password.file=/opt/alfresco52g/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/alfresco-jmxrmi.password $CATALINA_OPTS "
CATALINA_OPTS="-Dcom.sun.management.jmxremote.access.file=/opt/alfresco52g/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/alfresco-jmxrmi.access $CATALINA_OPTS "
Please note, that the service URL is something different:
Besides, you may need to put alfresco-jmxrmi.password in read-only mode. If not, tomcat will not start:
$ chmod 600 /opt/alfresco52g/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/alfresco-jmxrmi.password
3. Enabling JMX via Jolokia
As described in jolokia.org, Jolokia is a JMX-HTTP bridge giving an alternative to JSR-160 connectors. It is an agent based approach with support for many platforms. For using it, you just need to copy the corresponding jolokia.war (for jolokia http endpoint) in webapps directory and to install some helper utils like jmx4perl or j4psh for consuming the http bridge. The main con is just having to deploy jolokia.war in all your application servers to monitor.
4. Enabling JMX via manager proxy servlet
This is not the best aproximation, but manager app is installed in Tomcat by default. For example, if you use the default installer in Alfresco, the Tomcat manager application is deployed under webapps directory. You may enable JMXProxy servlet for monitoring JMX variables in Alfresco Community. The main problem is that the JMX info provided is not JSON or XML based-
5. Some notes about JMX clients
A final comment regarding JMX clients and utilities:
- jconsole and jvisualvm (with the corresponding mbean plugins) - they come with Oracle JVM. Both, they are the first you should use for browsing mbeans, getting monitoring information, enabling loggers, or restarting subsystems.
- jmxterm is text-based alternative that it is very useful in remote linux servers with no gui options.
- jmx4perl and j4psh are useful tools for jolokia related bridge
- check_jmx.jar plugin is also a java command line helper coming from Nagios JMX plugin for Alfresco.