Would you like to learn how to monitor a Tomcat server using Zabbix? In this tutorial, we are going to show you how to use Zabbix to monitor a Tomcat server.
• Ubuntu 18.04
• Ubuntu 19.04
• Ubuntu 20.04
• Zabbix 5.0.0
• Tomcat 9
In our example, the Zabbix server IP address is 192.168.100.9.
In our example, the Tomcat server IP address is 192.168.100.10.
Zabbix Playlist:
On this page, we offer quick access to a list of videos related to Zabbix installation.
Don’t forget to subscribe to our youtube channel named FKIT.
Zabbix Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Zabbix installation.
Tutorial Zabbix server – Installation on Ubuntu Linux
Install the MySQl database service.
Access the MySQL service command-line.
Create a database named zabbix.
Create a database user named zabbix.
In our example, the password kamisma123 was set to the user named zabbix.
Give the MySQL user named zabbix permission over the database named zabbix.
Download the Zabbix 5 installation package.
Import Zabbix database template inside MySQL.
Install the Apache web server and the required packages.
Find the location of the php.ini file on your system.
Edit the php.ini file.
Keep in mind that your PHP version and the location of the file may not be the same of mine.
Set the following items on the php.ini file:
Set the correct timezone to your location.
Restart the apache service.
Download and install the GOLANG package.
The GOLANG software was installed under the /usr/local folder.
In order to work properly, the GO software expect the system to have a set of environment variables.
Let’s create a file to automate the required environment variables configuration.
Here is the file content.
Reboot your computer.
Verify if the required environment variables were created automatically.
Here is the correct output:
Download and install the Java packages.
Find the Java installation directory.
In our example, Java was installed on the following directory: /usr/lib/jvm/java-11-openjdk-amd64
Create a file to configure the required Java variables.
Here is the file content.
Reboot the computer.
Verify if the system created automatically the environment variable named: JAVA_HOME.
Here is the command output.
Create a Linux account to the Zabbix user and install the required packages.
Compile and install the Zabbix server.
Find the location of the zabbix_server.conf file.
Here is the original file, before our configuration.
Here is the new file with our configuration.
Start the Zabbix Agent.
Start the Zabbix Java gateway.
Start the Zabbix server.
Move all the Zabbix frontend files to the root directory of your Apache installation.
Set the correct file permission.
Restart the Apache service.
Open your browser and enter the IP address of your web server plus /zabbix.
In our example, the following URL was entered in the Browser:
• http://192.168.100.9/zabbix
The Zabbix web installation interface should be presented.
On the next screen, you will have to check if all the requirements were achieved.
Click on the Next button.
Enter the Database information required to connect to the Zabbix database.
• Host: localhost
• Database Username: zabbix
• Database Password: kamisama123
On the next screen, you just have to click on the Next button.
Now, take a look on the configuration summary.
Click on the Next button.
On the next screen, you will have to click on the Finish button.
Congratulations! The Zabbix 5 installation was finished successfully.
Tomcat – Installing on Ubuntu Linux
• IP – 192.168.100.10
• Operational System – Ubuntu 20.04
• Hostname – TOMCAT
Install the Tomcat package.
Edit the Tomcat configuration file inside the directory: /etc/default.
Here is the original file, before our configuration.
Here is the new file with our configuration.
This will allow Zabbix to remotely connect on the TCP port 12345 of the Tomcat server.
Restart the Tomcat service.
Use the NETSTAT command to verify if the service is running on ports 8080 and 12345.
Here is the command output:
You have finished the required configuration to allow the Zabbix server to monitor Tomcat.
Zabbix – Monitor a Tomcat server
Access the Zabbix server dashboard and add the Linux computer running the Tomcat service as a Host.
Open your browser and enter the IP address of your web server plus /zabbix.
In our example, the following URL was entered in the Browser:
• http://192.168.100.9/zabbix
On the login screen, use the default username and default password.
• Default Username: Admin
• Default Password: zabbix
After a successful login, you will be sent to the Zabbix Dashboard.
On the dashboard screen, access the Configuration menu and select the Host option.
On the top right of the screen, click on the Create host button.
Enter the following information:
• Host Name – Enter a Hostname to identify the Tomcat server.
• Visible Hostname – Repeat the hostname.
• Group – Select the name of a group to identify similar devices.
• Interfaces – Delete the default interface and add a JMX interface.
• JMX Interfaces – Enter the IP address of the Tomcat server and the TCP port 12345.
Here is the new image with our configuration.
Next, we need to associate the host to a monitoring template.
Access the Templates tab on the top of the screen.
Click on the Select button and locate the template named: TEMPLATE APP APACHE TOMCAT JMX
Click on the Add button.
After a few minutes, you will be able to see the initial result on the Zabbix Dashboard.
In order to test your configuration, access the Monitoring menu, and click on the option named: Latest data.
Find your server and click on the Apply button.
In order to test your configuration, access the Monitoring menu, and click on the Hosts option.
Find your server and click on the Graphs option.
Zabbix will display the graphics available to monitor the Tomcat service.
Congratulations! You configured the Zabbix server to monitor a Tomcat server.