Installation of Zabbix 4.0
- Author: Miroslav Kohútik
- Operating system : Ubuntu 16.04
This guide describes the individual steps of the installation process of Zabbix version 4.0 on Ubuntu 16.04 operating system.
Zabbix is a free open-source monitoring software. Zabbix provides monitoring of many metrics about the state of the administered network and its devices and services (including virtual machines).
Zabbix utilizes the services of Apache web server, SQL database (in our case MySQL) and the PHP language to display web interface.
Before installation of Zabbix itself, install the aforementioned components first.
Update the list of available APT packages and install the apache server, MySQL server, PHP language and its necessary components.
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-php
sudo apt-get install mysql-server
sudo apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql
Now you need to manually set the time zone in PHP configuration file located at /etc/php/PHP_VERSION/apache2/php.ini. Search for the section [Date] and set the parameter date.timezone to the timezone you are located in. The list of supported timezones can be found here.
Download and install the APT repository configuration package and update the APT package list once again. We have used the Ubuntu 16.04 operating system, for Ubuntu 14.04 installation substitute “xenial” with “trusty”, for Ubuntu 18.04 installation substitute “xenial” with “bionic”.
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+xenial_all.deb
sudo dpkg -i zabbix-release_4.0-2+xenial_all.deb
sudo apt-get update
Install the central component Zabbix server and Zabbix front-end on the machine where you want to collect the monitoring data.
sudo apt-get install zabbix-server-mysql
sudo apt-get install zabbix-frontend-php
Create the MySQL database and a Zabbix user. The first command opens the MySQL command line interface, the rest are MySQL commands.
mysql -u root -p
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
quit;
Import the initial data to the database:
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql - uzabbix -p zabbix
Open the Zabbix server configuration file and append the following lines. Replace the < password > with the password you have created for MySQL.
sudo nano /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<password>
Start the Zabbix server
sudo systemctl start zabbix-server.service
Use the following command to run Zabbix on startup
update-rc.d zabbix-server enable
Restart the Apache web server
sudo systemctl restart apache2.service
Now you should be able to access the Zabbix web interface on http://IP_ADDRESS_OF_INTERFACE/zabbix/.
Install and run the Zabbix agent on the machine you want to monitor
sudo apt-get install zabbix-agent
sudo systemctl start zabbix-agent.service
Source:
- Installation from packages – Zabbix documentation