Would you like to learn how to use Zabbix to monitor the Apache webserver log files? In this tutorial, we are going to show you how to configure Zabbix to monitor the Apache log file on a computer running Ubuntu linux.
• Zabbix version: 4.2.6
• Ubuntu version: 18.04
You need to install the Zabbix agent on the computer running Linux.
Equipment list
Here you can find the list of equipment used to create this tutorial.
This link will also show the software list used to create this tutorial.
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.
Zabbix Agent – Configuration required
First, the Zabbix agent installed on the Linux computer must be configured in Active mode.
Here is an example of a Zabbix agent configuration file in Passive mode:
Here is an example of a Zabbix agent configuration file in Active mode:
Next, you need to check the Apache log file permissions.
In our example, we are going to monitor the access.log and the error.log files.
List the log file permisions using the LS command.
As you can see, members of the group ADM are able to read the Apache log files.
Use the following command to add the Zabbix user to the ADM group.
Next, you need to restart the Zabbix agent.
You have finished the required part of the configuration.
Zabbix – How to Monitor Apache Log Files
Now, we need to access the Zabbix server dashboard and add the Linux computer 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://35.162.85.57/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.
On the Host configuration screen, you will have to enter the following information:
• Host Name – Enter a Hostname to monitor.
• Visible Hostname – Repeat the hostname.
• New group – Enter a name to identify a group of similar devices.
• Agent Interface – Enter the IP address of the Hostname.
Here is the original image, before our configuration.
Here is the new image with our configuration.
Click on the Add button to include this host on the Zabbix database.
On the dashboard screen, access the Configuration menu and select the Host option.
Locate and click on the hostname that you created before.
In our example, we selected the hostname: LINUX-SERVER-01
On the Host properties screen, access the Applications tab.
On the top right part of the screen, click on the Create application button.
On the Host applications screen, create a new application named: LOG
After finishing the Application creation, access the Items tab.
On the top right part of the screen, click on the Create item button.
On the Item creation screen, you need to configure the following items:
Click on the Add button to finish the Item creation.
Now, let’s create a new item to monitor the Apache error.log file.
On the top right part of the screen, click on the Create item button.
On the Item creation screen, you need to configure the following items:
Click on the Add button to finish the Item creation and wait 5 minutes.
In order to test your configuration, access the Monitoring menu and click on the Latest data option.
Use the filter configuration to select the desired hostname and click on the Apply button.
In our example, we selected the hostname LINUX-SERVER-01
You should be able to see the results of your Apache log file monitoring using Zabbix.
Congratulations! You have configured the Zabbix Apache log file monitoring on Linux.