Setting up JMX monitoring
Zabbix has JMX monitoring built into it so that we can monitor our Java applications. In this recipe, we’ll learn how to monitor Apache Tomcat with Zabbix JMX so that 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 so that we can monitor our JMX application.
I used a CentOS 7 machine for 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 this example. You can add the following to your Tomcat configuration after installing it to get it working for this 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...