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.

Tutorial Zabbix server – Installation on Ubuntu Linux

Install the MySQl database service.

Copy to Clipboard

Access the MySQL service command-line.

Copy to Clipboard

Create a database named zabbix.

Copy to Clipboard

Create a database user named zabbix.

Copy to Clipboard

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.

Copy to Clipboard

Download the Zabbix 5 installation package.

Copy to Clipboard

Import Zabbix database template inside MySQL.

Copy to Clipboard

Install the Apache web server and the required packages.

Copy to Clipboard

Find the location of the php.ini file on your system.

Edit the php.ini file.

Copy to Clipboard

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:

Copy to Clipboard

Set the correct timezone to your location.

Restart the apache service.

Copy to Clipboard

Download and install the GOLANG package.

Copy to Clipboard

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.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Reboot your computer.

Copy to Clipboard

Verify if the required environment variables were created automatically.

Copy to Clipboard

Here is the correct output:

Copy to Clipboard

Download and install the Java packages.

Copy to Clipboard

Find the Java installation directory.

Copy to Clipboard

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.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Reboot the computer.

Copy to Clipboard

Verify if the system created automatically the environment variable named: JAVA_HOME.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Create a Linux account to the Zabbix user and install the required packages.

Copy to Clipboard

Compile and install the Zabbix server.

Copy to Clipboard

Find the location of the zabbix_server.conf file.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

Start the Zabbix Agent.

Copy to Clipboard

Start the Zabbix Java gateway.

Copy to Clipboard

Start the Zabbix server.

Copy to Clipboard

Move all the Zabbix frontend files to the root directory of your Apache installation.

Set the correct file permission.

Copy to Clipboard

Restart the Apache service.

Copy to Clipboard

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.

zabbix 5 install

On the next screen, you will have to check if all the requirements were achieved.

Click on the Next button.

Zabbix 5 requirements

Enter the Database information required to connect to the Zabbix database.

• Host: localhost
• Database Username: zabbix
• Database Password: kamisama123

Zabbix 5 database configuration

On the next screen, you just have to click on the Next button.

zabbix agent

Now, take a look on the configuration summary.

Click on the Next button.

Zabbix 5 installation summary

On the next screen, you will have to click on the Finish button.

zabbix installation

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.

Copy to Clipboard

Edit the Tomcat configuration file inside the directory: /etc/default.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

This will allow Zabbix to remotely connect on the TCP port 12345 of the Tomcat server.

Restart the Tomcat service.

Copy to Clipboard

Use the NETSTAT command to verify if the service is running on ports 8080 and 12345.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

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

zabbix login

After a successful login, you will be sent to the Zabbix Dashboard.

Zabbix 5 Dashboard

On the dashboard screen, access the Configuration menu and select the Host option.

Zabbix 5 hosts menu

On the top right of the screen, click on the Create host button.

Zabbix Create Host

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.

Zabbix monitor Tomcat

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.

Zabbix 5 Latest data

Find your server and click on the Apply button.

Monitor Tomcat

In order to test your configuration, access the Monitoring menu, and click on the Hosts option.

Zabbix 5 monitoring hosts menu

Find your server and click on the Graphs option.

Zabbix will display the graphics available to monitor the Tomcat service.

monitoring tomcat

Congratulations! You configured the Zabbix server to monitor a Tomcat server.