Zabbix is a very popular monitor tool used widely to collect metrics related to Networks, Physical or Virtual Servers, and IT infra. It also has GUI to display the collected metrics and it is released under the terms of General Public License version 2. Thus, It is a free-to-use software.
In this article, we will be going through the steps required to install and run Zabbix on Ubuntu 20.04
Installing Zabbix:
Database and Webserver
We will be using Apache and MySQL as web and database servers respectively for this installation.
- Update and upgrade your system.
$ sudo apt update -y
$ sudo apt upgrade -y - Install Apache along with the required PHP packages.
$ sudo apt install apache2 php php-mysql php-mysqlnd php-ldap php-bcmath php-mbstring php-gd php-pdo php-xml libapache2-mod-php
- We need to modify php values to fine-tune with the Zabbix server.
Concatinate the below variables to the file.$ vi /etc/php.ini
You can select the timezone that is local to you. Check out the official zones for more information.post_max_size = 16M upload_max_filesize = 2M max_execution_time 300 max_input_time = 300 memory_limit 128M session.auto_start = 0 mbstring.func_overload = 0 date.timezone = Europe/Bucharest
- Restart the Apache server for the changes to be applied.
$ sudo systemctl restart apache2.service
- Install Maria DB
$ sudo apt-get install mariadb-server mariadb-client libmariadb-dev
$ sudo systemctl start mariadb
- Secure your database by running mysql_secure_installation.
$ sudo mysql_secure_installation
- Create Zabbix Database and the user.
$ mysql -u root -p
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';
flush privileges;
exit;
Installing Zabbix Server
- Install the zabbix repo.
$ sudo wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu20.04_all.deb
$ sudo dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb
$ sudo apt update - Install the Zabbix server, frontend, and agent.
$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
- Import Initial schema data and the password for the zabbix user.
$ sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
- Configure zabbix Database password.
Search and provide value for the DBPassword and AllowUnsupportedDBVersions variable as shown below syntax.$ sudo vi /etc/zabbix/zabbix_server.conf
DBPassword=yourpassword
AllowUnsupportedDBVersions=1 - Restart Zabbix processes and Apache web server.
$ sudo systemctl restart zabbix-server zabbix-agent apache2
$ sudo systemctl enable zabbix-server zabbix-agent apache2
Access your Zabbix server at http://<yourhost_IPv4/zabbix/
just hit the Next Step button to move to the new step of the installation process.Use the Deafult credentials of zabbix admin user User: Admin, Password: zabbix