Sunday, September 25, 2022

How To Install and Configure Zabbix 6.0 on Debian 11

In this article, we want to teach you How To Install and Configure Zabbix 6.0 on Debian 11.

Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual machines (VMs), and cloud services. Zabbix provides monitoring metrics, such as network utilization, CPU load, and disk space consumption.

The software monitors operations on Linux, Hewlett Packard Unix (HP-UX), Mac OS X, Solaris, and other operating systems (OSes); however, Windows monitoring is only possible through agents.

How To Install and Configure Zabbix 6.0 on Debian 11

To install Zabbix 6.0 LTS, you need to log in to your server as a non-root user with sudo privileges. To do this, you can follow our article the Initial Server Setup with Debian 11.

Now follow the steps below to complete this guide.

Install Zabbix 6.0 LTS on Debian 11

By default, the Zabbix repository is not available in the default Debian repository. First, you need to add the Zabbix 6.0 repository to your server with the following commands:

# wget https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/zabbix-release_6.0-1+debian11_all.deb
# sudo dpkg -i zabbix-release_6.0-1+debian11_all.deb

Then, you need to update your local package index with the following command:

sudo apt update
At this point, you can install the Zabbix server, frontend, agent on Debian 11 with the command below:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

When your installation is completed, you need to create the initial database. To do this, you need to install MariaDB or MySQL.

Install and Configure MariaDB for Zabbix 6.0

Install the MariaDB server on Debian 11 with the following command:

sudo apt install mariadb-server

Then, start and enable your MariaDB service with the following command:

sudo systemctl enable --now mariadb

Now you need to secure your database server by changing the default password for MySQL root. Run the script below:

sudo mysql_secure_installation
Enter current password for root (enter for none): Press Enter
Switch to unix_socket authentication [Y/n] y
Change the root password? [Y/n] y
New password: <Enter root DB password>
Re-enter new password: <Repeat root DB password>
Remove anonymous users? [Y/n]: Y
Disallow root login remotely? [Y/n]: Y
Remove test database and access to it? [Y/n]:  Y
Reload privilege tables now? [Y/n]:  Y

At this point, you can create your initial database. First, log in to your MariaDB shell with the command below:

sudo mysql -uroot -p

Then, create your Zabbix database, here we named it Zabbix:

MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;

Next, create a Zabbix user with a strong password:

MariaDB [(none)]> create user [email protected] identified by 'password';

Grant all the privileges to it and exit from your MariaDB shell with the commands below:

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected];
MariaDB [(none)]> quit;

Now you need to import the database schema for the Zabbix server with the command below:

sudo zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix

You will be asked to enter the Zabbix user password and wait to get completed.

At this point, you need to open the Zabbix server configuration file and make changes as shown below.

Open the file with your favorite text editor, here we use vi:

sudo vi /etc/zabbix/zabbix_server.conf

You need to set your configurations for database connection:

DBName=zabbix 
DBUser=zabbix 
DBPassword=zabbixDBpassword

When you are done, save and close the file.

Now start and enable your Zabbix server and agent on Debian 11:

sudo systemctl restart zabbix-server zabbix-agent 
sudo systemctl enable zabbix-server zabbix-agent

Configure PHP for Zabbix 6.0 frontend

Here you need to configure PHP for your Zabbix 6.0 frontend on Debian 11. Open the file with your favorite text editor, here we use vi:

sudo vi /etc/zabbix/apache.conf

Uncomment the line below by removing the # from the beginning of the line and setting the right time zone for your country:

php_value date.timezone Europe/Amsterdam

When you are done, save and close the file.

Restart and enable your Apache service on Debian 11:

#sudo systemctl restart apache2
#sudo systemctl enable apache2

Access Zabbix 6.0 Web Interface

At this point, you can continue your Zabbix 6.0 installation on Debian 11 from the web interface. To do this, type your server’s IP address in your web browser followed by zabbix:

http://server_ip_or_dns_name/zabbix

You will see the welcome screen. Select your desired language and click Next step.

Zabbix 6.0 welcome screen

Next, check of pre-requisites and click Next step.

Zabbix 6.0 pre-installation

After that, you need to configure the DB connection. Enter your Zabbix database and user password and click Next step.

Configure Zabbix 6.0 DB connection

Then, you need to choose your Zabbix server name and your desired theme and click Next step.

Choose Zabbix server name

Check your pre-installation option and click Next step. You will see the Congratulations note that you have successfully installed the Zabbix frontend. Click Finish.

Finish Zabbix 6.0 installation

You will get into the login screen. Use Zabbix default admin username “Admin” and password “zabbix” (without quotes) to login into the Zabbix frontend.

Zabbix 6.0 login screen on Debian 11

At this point, you will see your Zabbix 6.0 dashboard.

Zabbix 6.0 dashboard on Debian 11

Conclusion

At this point, you learn to Install and Configure Zabbix 6.0 on Debian 11.

Hope you enjoy it.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular