How To Install Zabbix 4.x on Debian 10 / Debian 9

0

Zabbix is an open-source monitoring tool for servers, network devices, and applications. It uses agents (Zabbix agent) installed on monitored hosts to collect the data.

Zabbix also supports agentless monitoring via SNMP, TCP, and ICMP checks, as well as over IPMI, JMX, SSH, and telnet.

Here, we will see how to install Zabbix Server Debian 10 and Debian 9.

THIS DOCUMENT IS ALSO AVAILABLE FOR

System Requirements

Hardware

Zabbix requires a minimum of 128MB of RAM and 256MB of HDD space. However, the amount of memory or hard disk space depends on the number of hosts and parameters are being monitored.

2 CPU core and 2GB of RAM would be sufficient to monitor 500 hosts.

Software

Apache: 1.3.12 or later
MariaDB or MySQL / PostgreSQL
PHP: 5.4.0 or later

Install Zabbix

Configure Zabbix repository

Zabbix server and agents packages are not available in Debian base OS repositories. So, we will configure the Zabbix repository on the system by installing the Zabbix repository configuration package to obtain required packages.

Zabbix 4.0 (LTS)

### Debian 10 ###

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+buster_all.deb
sudo dpkg -i zabbix-release_4.0-3+buster_all.deb

### Debian 9 ###

wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+stretch_all.deb
sudo dpkg -i zabbix-release_4.0-3+stretch_all.deb

Zabbix 4.2 (Latest)

### Debian 10 ###

wget https://repo.zabbix.com/zabbix/4.2/debian/pool/main/z/zabbix-release/zabbix-release_4.2-2+buster_all.deb
sudo dpkg -i zabbix-release_4.2-2+buster_all.deb

### Debian 9 ###

wget https://repo.zabbix.com/zabbix/4.2/debian/pool/main/z/zabbix-release/zabbix-release_4.2-2+stretch_all.deb
sudo dpkg -i zabbix-release_4.2-2+stretch_all.deb

Install Zabbix Server

Use the apt command to install Zabbix server with MySQL/MariaDB support package to have MariaDB/MySQL as a database server.

sudo apt update

sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-agent

Timezone

Edit the Zabbix configuration file to modify the timezone as per your geographic location.

sudo nano /etc/zabbix/apache.conf

Update the below line with correct timezone, see more time zones.

<IfModule mod_php7.c>

...
...

php_value date.timezone America/New_York

...
...

</IfModule>

Create Zabbix database

Login to the MySQL / MariaDB and create a database for Zabbix installation.

You can log in to MariaDB server without the database root password with sudo mysql -u root -p or running mysql -u root -p command as root in Debian.
sudo mysql -u root -p

Create a database with the following details.

DBName: zabbixdb
DBUser: zabbixuser
DBPassword: password

create database zabbixdb character set utf8 collate utf8_bin;

grant all privileges on zabbixdb.* to [email protected] identified by 'password';

quit;

Upon creating a database for Zabbix installation, import the initial schema, and data into it.

cd /usr/share/doc/zabbix-server-mysql

zcat create.sql.gz | mysql -u zabbixuser -p zabbixdb

Update Zabbix Configuration

Edit the zabbix_server.conf file to set the database details.

sudo nano /etc/zabbix/zabbix_server.conf

Make sure you set as follows.

DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password

Restart all the services.

sudo systemctl restart zabbix-server zabbix-agent apache2

Enable the services to start automatically on system boot.

sudo systemctl enable zabbix-server zabbix-agent apache2

Setup Zabbix via Web Installer

Open a web browser and go to the following URL.

http://your-ip-add-ress/zabbix/

Click Next Step on Zabbix welcome page.

Install Zabbix on Debian 10 - Welcome Screen
Install Zabbix on Debian 10 – Welcome Screen

Zabbix web installer now verifies whether all pre-requisites are met for installation or there are any issues.

If there are no errors, click Next Step.

Install Zabbix on Debian 10 - Zabbix Pre-Installation Checks
Install Zabbix on Debian 10 – Zabbix Pre-Installation Checks

Type the Zabbix database name, DB user, and the database password in the respective fields. Then, click Next Step.

Install Zabbix on Debian 10 - DB Configuration
Install Zabbix on Debian 10 – DB Configuration

Mention the Zabbix server host, port number, and the name for Zabbix server.

Install Zabbix on Debian 10 - Zabbix Server Details
Install Zabbix on Debian 10 – Zabbix Server Details

You will now get a pre-installation summary something like below. Click Next Step.

Install Zabbix on Debian 10 - Zabbix Pre-Installation Summary
Install Zabbix on Debian 10 – Zabbix Pre-Installation Summary

Zabbix server installation is now complete. Click Finish.

Install Zabbix on Debian 10 - Zabbix Installation Completed
Install Zabbix on Debian 10 – Zabbix Installation Completed

Once you click the Finish button, the installer will redirect you to the Zabbix Login Page.

Access Zabbix

Log in to Zabbix Server with the default username and password.

http://your-ip-add-ress/zabbix

Username: Admin

Password: zabbix

Username is case sensitive.
Login To Zabbix Monitoring Tool
Login To Zabbix Monitoring Tool

Zabbix Dashboard:

Zabbix Monitoring Dashboard
Zabbix Monitoring Dashboard

Conclusion

That’s All. I hope this post helped you to install Zabbix 4.x on Debian 10 / Debian 9. You can now install Zabbix Agent on client machines and then add your client machines to Zabbix server for monitoring.

You might also like