Edited 2 weeks ago by ExtremeHow Editorial Team
DebianZabbixMonitoringServer SetupLinuxOpen SourceSystem AdministrationCLIITSoftware
This content is available in 7 different language
Zabbix is an open-source monitoring software for networks and applications. It can be used to track the status of various services, network hardware, servers, and other IT resources. Here, we will walk you through the detailed procedure to install and configure Zabbix on Debian systems.
Before you begin the installation, make sure you have the following prerequisites met:
sudo
access to the Debian server.The first step in installing any software is to make sure your system is up to date. An updated system ensures that all system packages are the latest, usually the safest option available. Use the following command to update your Debian system:
sudo apt update sudo apt upgrade
This will get the updated package list and upgrade the current outdated packages to the latest available versions.
Zabbix requires a web server, a database management system, and PHP. For this tutorial, we will be using Apache, MySQL, and PHP, collectively called the "LAMP stack." Here's how to install them:
To install Apache, execute the command:
sudo apt install apache2
After the installation is complete, you can check whether the Apache service is running or not by using the following:
sudo systemctl status apache2
MySQL will be used to manage Zabbix data. Install it using the following:
sudo apt install mysql-server
Once installed, secure your MySQL installation:
sudo mysql_secure_installation
Follow the on-screen instructions to set your root password and secure your database.
Zabbix requires PHP for its web interface. Let's install PHP and commonly used PHP extensions:
sudo apt install php libapache2-mod-php php-mysql php-xml php-bcmath php-mbstring php-ldap php-json php-gd
Once PHP is installed, we need to make a little change to the PHP configuration. Open the PHP configuration file in a text editor and make the changes shown below:
sudo nano /etc/php/7.3/apache2/php.ini
Make sure the following configurations are as shown:
max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M date.timezone = "UTC" (replace UTC with your timezone)
To store Zabbix data, set up a MySQL database and user. Log into MySQL:
sudo mysql -u root -p
Then execute the SQL command below. You can replace “your_db_password” with the password of your choice:
CREATE DATABASE zabbixdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'zabbixuser'@'localhost' IDENTIFIED BY 'your_db_password'; GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbixuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Zabbix is not included in the default repository in Debian. So, we need to add the Zabbix repository. You can download and install the repository using the wget
command:
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb sudo dpkg -i zabbix-release_5.0-1+buster_all.deb sudo apt update
After successful configuration of your system, it is now time to install the Zabbix server, web frontend, and agent. Use the following installation commands:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
To import the database schema and initial data into the database, execute the following command. Replace “zabbixuser” and “your_db_password” with your previously set MySQL user credentials.
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbixuser -p zabbixdb
Once the database is set up, configure the server as shown below. Edit the Zabbix server configuration file:
sudo nano /etc/zabbix/zabbix_server.conf
Find and configure the following parameters:
DBName=zabbixdb DBUser=zabbixuser DBPassword=your_db_password
The Apache configuration file for Zabbix must be adjusted before it can be accessed via the browser. Edit the configuration as shown below:
sudo nano /etc/zabbix/apache.conf
Set the PHP timezone according to your needs. For example:
php_value date.timezone Europe/London
To ensure that Zabbix runs simultaneously with system startup, enable and launch the Zabbix server and agent services:
sudo systemctl start zabbix-server zabbix-agent apache2 sudo systemctl enable zabbix-server zabbix-agent apache2
Open your web browser and visit http://your_server_ip_address/zabbix. Follow the step-by-step guide offered by Zabbix to complete further configuration and connectivity checks.
By default, Zabbix's administration username and password are:
Congratulations, if you have reached this point, you now have a fully operational Zabbix server running on a Debian system. This tool can now help you monitor both hardware and software systems in your network. With vast customization options and support from its active community, Zabbix is a powerful ally in managing IT infrastructure.
If you find anything wrong with the article content, you can