Would you like to learn how to do a Zabbix installation on Ubuntu Linux? In this tutorial, we are going to show you how to install, configure and access Zabbix on a computer running Ubuntu Linux version 18.
Hardware List:
The following section presents the list of equipment used to create this Zabbix tutorial.
Every piece of hardware listed above can be found at Amazon website.
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 – 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.
# date
If the system shown the correct date and time, this means that you followed all the steps correctly.
Tutorial – MySQL Ubuntu Linux
Now, we can proceed to the installation of the database service.
On the Linux console, use the following commands to install the required packages.
# apt-get update
# apt-get install mysql-server mysql-client
The installation wizard will ask you for a password to the root user.
If the installation wizard does not ask you for a password, it means that your root password is empty.
After finishing the installation, use the following command to access the MySQL database server.
To access the database server, enter the password set on the MySQL server installation wizard.
# mysql -u root -p
Use the following SQL command to create a database named zabbix.
CREATE DATABASE zabbix CHARACTER SET UTF8 COLLATE UTF8_BIN;
Use the following SQL command to create a database user named zabbix.
CREATE USER ‘zabbix’@’%’ IDENTIFIED BY ‘kamisama123’;
Give the SQL user named zabbix permission over the database named zabbix.
GRANT ALL PRIVILEGES ON zabbix.* TO ‘zabbix’@’%’;
quit;
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
Now, we need to import Zabbix database template inside MySQL.
Extract the Zabbix installation package and import the database template inside MySQL.
The system will request the password of the Zabbix SQL user everytime you try to import a file.
# tar -zxvf zabbix-3.4.12.tar.gz
# cd zabbix-3.4.12/database/mysql
# mysql -u zabbix -p zabbix < schema.sql
# mysql -u zabbix -p zabbix < images.sql
# mysql -u zabbix -p zabbix < data.sql
You have finished the database installation.
You have imported the Zabbix database templates on the MySQL Server.
Tutorial – Installing Apache on Linux
Next, we need to install the Apache web server and all the required software.
On the Linux console, use the following commands to install the required packages.
# apt-get install apache2 php libapache2-mod-php php-cli
# apt-get install php-mysql php-mbstring php-gd php-xml
# apt-get install php-bcmath php-ldap
Now, you should find the location of the php.ini file on your system.
After finding, you need to edit the php.ini file.
# updatedb
# locate php.ini
# vi /etc/php/7.2/apache2/php.ini
Keep in mind that your PHP version and the location of the file may not be the same of mine.
Here is the original file, before our configuration.
max_execution_time = 30
memory_limit = 128M
post_max_size = 8M
max_input_time = 60
; date.timezone =
Here is the new file with our configuration.
max_execution_time = 300
memory_limit = 256M
post_max_size = 32M
max_input_time = 300
date.timezone = America/Sao_Paulo
Keep in mind that you have to set your PHP timezone.
In our example, we used the timezone America/Sao_Paulo
You should also restart apache manually and verify the service status.
# service apache2 stop
# service apache2 start
# service apache2 status
Here is an example of the Apache service status output.
● apache2.service – LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Mon 2018-04-23 00:02:09 -03; 1min 4s ago
Tutorial – Zabbix Installation on Ubuntu
Now, we need to install the Zabbix server 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 libmysqlclient-dev libssl-dev libsnmp-dev libevent-dev
# apt-get install libopenipmi-dev libcurl4-openssl-dev libxml2-dev libssh2-1-dev libpcre3-dev
# apt-get install libldap2-dev libiksemel-dev libcurl4-openssl-dev libgnutls28-dev
On the Linux console, use the following commands to access the Zabbix package folder.
# cd /downloads/zabbix-3.4.12
# ls
aclocal.m4 build conf configure database include m4 man NEWS src
AUTHORS ChangeLog config.guess configure.ac depcomp INSTALL Makefile.am misc README upgrades
bin compile config.sub COPYING frontends install-sh Makefile.in missing sass
Compile and install the Zabbix server using the following commands:
# ./configure –enable-server –enable-agent –with-mysql –with-openssl –with-net-snmp –with-openipmi –with-libcurl –with-libxml2 –with-ssh2 –with-ldap
# make
# make install
Now, you should find the location of the zabbix_server.conf file on your system.
After finding, you need to edit the zabbix_server.conf file.
# updatedb
# locate zabbix_server.conf
# vi /usr/local/etc/zabbix_server.conf
Here is the original file, before our configuration.
LogFile=/tmp/zabbix_server.log
DBName=zabbix
DBUser=zabbix
Timeout=4
LogSlowQueries=3000
Here is the new file with our configuration.
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=kamisama123
Timeout=4
LogSlowQueries=3000
After finishing the configuration, use the following command to start the Zabbix server:
# /usr/local/sbin/zabbix_server
After finishing the configuration, use the following command to start the Zabbix Agent:
# /usr/local/sbin/zabbix_agentd
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/* /etc/init.d/
You can now use the following commands to start the Zabbix server service.
# /etc/init.d/zabbix-server start
You can now use the following commands to start the Zabbix agent service.
# /etc/init.d/zabbix-agent start
Move all the Zabbix frontend files to the root directory of your Apache installation.
Set the correct file permission on all moved files.
# cd /downloads/zabbix-3.4.12/frontends
# mkdir /var/www/html/zabbix
# mv php/* /var/www/html/zabbix
# chown www-data.www-data /var/www/html/zabbix/* -R
Restart the Apache service.
# service apache2 stop
# service apache2 start
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
The Zabbix web installation interface should be presented.
Click on the Next button.
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.
Finally, you will be presented with the Zabbix login screen.
• Zabbix default username: Admin
• Zabbix default Password: zabbix
After a successful login, you will be sent to the Zabbix Dashboard.
Congratulations, you have installed the Zabbix system on Ubuntu Linux.
Now, we need to enable the Zabbix server to monitor itself.
On the Zabbix dashboard, access the Configuration menu and select the Host option.
On the top right of the screen, select the option named: Zabbix servers
Locate the host named Zabbix server and click on the word DISABLED.
This will enable the Zabbix server to monitor itself.
The Zabbix server status will turn from DISABLED to ENABLED.
The Zabbix server is now being monitored.