Setting up JMX monitoring
Built into Zabbix is JMX monitoring, so we can monitor our Java applications. In this recipe, we'll check out how to monitor Apache Tomcat with Zabbix JMX so we can get a feel for what this monitoring option is all about.
Getting ready
To get ready for this recipe, we are going to need our Zabbix server to monitor our JMX application.
I used a CentOS 7 machine for the example in this recipe, with Tomcat installed. It can be quite tricky to use Tomcat on later CentOS versions due to package dependencies, so I recommend sticking with CentOS 7 for the example. You can add the following to your Tomcat configuration after installation to get it working in our recipe:
JAVA_OPTS="-Djava.rmi.server.hostname=10.16.16.155 dcom.sun.management.jmxremote dcom.sun.management.jmxremote.port=12345 dcom.sun.management.jmxremote.authenticate=false dcom.sun.management.jmxremote.ssl=false"
If you want to set up JMX monitoring in your production...