Would you like to learn how to do a Zabbix agent installation on Ubuntu Linux? In this tutorial, we are going to show you how to install and configure the Zabbix agent software on a computer running Ubuntu Linux version 18.
Zabbix Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Zabbix installation.
Tutorial - NTP on Ubuntu Linux
First, we are going to configure the system to use the correct date and time using NTP.
On the Linux console, use the following commands to set the correct timezone.
# dpkg-reconfigure tzdata
Install the Ntpdate package and set the correct date and time immediately.
# apt-get update
# apt-get install ntpdate
# ntpdate pool.ntp.br
The Ntpdate command was used to set the correct date and time using the server: pool.ntp.br
Let's install the NTP service.
# apt-get install ntp
NTP is the service that will keep our server updated.
Use the command date to check the date and time configured on your Ubuntu Linux.
If the system shown the correct date and time, this means that you followed all the steps correctly.
Tutorial - Zabbix Agent Installation on Ubuntu
Now, we need to install the Zabbix agent on Ubuntu Linux.
On the Linux console, use the following commands to install the required packages.
# groupadd zabbix
# useradd -g zabbix -s /bin/bash zabbix
# apt-get update
# apt-get install build-essential libpcre3-dev
On the Linux console, use the following commands to download the Zabbix installation package.
# mkdir /downloads
# cd /downloads
# wget https://ufpr.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.12/zabbix-3.4.12.tar.gz
Extract the Zabbix installation package, compile and install the Zabbix agent.
# tar -zxvf zabbix-3.4.12.tar.gz
# cd zabbix-3.4.12/
# ./configure --enable-agent
# make install
Now, you should find the location of the zabbix_agentd.conf file on your system.
You need to edit the zabbix_agentd.conf file.
# locate zabbix_agentd.conf
# vi /usr/local/etc/zabbix_agentd.conf
Here is the original file, before our configuration.
Here is the new file with our configuration.
In our example, the Zabbix agent is configured to allow the connection of the Zabbix server 220.127.116.11.
The server with the IP address 18.104.22.168 is allowed to request and receive information from the agent.
The Localhost, 127.0.0.1, is allowed to request and receive information from the agent.
After finishing the configuration, use the following command to start the Zabbix agent:
The Zabbix installation package comes with a service startup script.
If you want, copy the startup script using the commands below.
# cd /downloads/zabbix-3.4.12/
# cp misc/init.d/debian/zabbix-agent /etc/init.d/
You can now use the following commands to start the Zabbix agent service.
# /etc/init.d/zabbix-agent start
Use the following command to verify the Zabbix agent log file.
If the Zabbix agent was started successfully, you should see a message similar to this.
26691:20180803:175741.642 TLS support: NO
26691:20180803:175741.642 using configuration file: /usr/local/etc/zabbix_agentd.conf
26691:20180803:175741.642 agent #0 started [main process]
26692:20180803:175741.643 agent #1 started [collector]
26693:20180803:175741.643 agent #2 started [listener #1]
26694:20180803:175741.643 agent #3 started [listener #2]
26696:20180803:175741.644 agent #5 started [active checks #1]
26695:20180803:175741.644 agent #4 started [listener #3]
26696:20180803:175741.659 no active checks on server [192.168.0.200:10051]: host [ubuntu18] not found
Congratulations! you have installed the Zabbix agent on a computer running Ubuntu Linux.
You can now use the Zabbix server dashboard to add this computer to the network monitoring service.
Tutorial - Zabbix Monitor Linux
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:
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 identify the Linux server.
• 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 Linux server.
Here is the original image, before our configuration.
Here is the new image with our configuration.
Next, we need to associate the host with a specific network monitor template.
By default, Zabbix comes with a large variety of monitoring templates.
Access the Templates tab on the top of the screen.
Click on the Select button and locate the template named: TEMPLATE OS Linux
Click on the Add button (1).
Click on the Add button (2).
After a few minutes, you will be able to see the initial result on the Zabbix Dashboard.
The final result will take at least one hour.
By default, Zabbix will wait 1 hour to discover the number of interfaces available on the Linux computer.
By default, Zabbix will wait 1 hour before collect information from the network interfaces.
In order to test your configuration, access the Monitoring menu and click on the Graphs option.
On the top right of the screen, select the group named ALL.
Select your Linux computer host name.
Select the graph named: CPU UTILIZATION
You should be able to see the graphic of CPU utilization.
Congratulations! You have configured the Zabbix server to monitor a Linux computer.