Operations 11 min read

Mastering Zabbix: Install and Configure the Open‑Source Monitoring System

This article provides a comprehensive overview of Zabbix, an open‑source, web‑based monitoring solution, detailing its architecture, key features, monitoring principles, core components, default ports, and step‑by‑step instructions for deploying both the server and agent on Linux systems.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Mastering Zabbix: Install and Configure the Open‑Source Monitoring System

Zabbix Monitoring System Overview

What is Zabbix?

Zabbix is an enterprise‑grade open‑source solution that provides distributed system and network monitoring via a web interface.

It can monitor various network parameters to ensure server safety and offers flexible notification mechanisms for rapid issue localization and resolution.

The system consists of two main parts: Zabbix server and the optional Zabbix agent, using a client‑server model for data collection and a browser‑server model for web display and configuration.

Zabbix server can collect data via SNMP, Zabbix agent, ping, port checks, etc., and runs on Linux and other platforms.

Zabbix agent is installed on monitored hosts to gather hardware and OS information such as memory and CPU usage.

Main Features of Zabbix

Easy installation and low learning curve.

Multi‑language support, including Chinese.

Free and open source.

Automatic service discovery.

Distributed monitoring and centralized web management.

Agent‑less monitoring capability.

Robust user authentication and flexible authorization.

Web‑based configuration and result viewing.

Email and other notification functions.

Key Functions of Zabbix

CPU load monitoring.

Memory usage tracking.

Disk usage monitoring.

Network status inspection.

Port monitoring.

Log monitoring.

Monitoring Principle

Zabbix agent runs on the monitored host, periodically collecting local metrics and sending them to the Zabbix server. The server stores the data in a database, and the web interface visualizes it. When a monitored item exceeds a configured trigger threshold, Zabbix can execute actions such as sending emails, WeChat messages, SMS, or running shell commands.

Core Components (Five Programs)

Zabbix server – daemon that receives data from agents, get, sender, and proxy.

Zabbix agent – client daemon that collects CPU load, memory, disk usage, etc.

Zabbix proxy – distributed proxy daemon for large‑scale deployments (typically >50 hosts).

Zabbix get – command‑line tool to retrieve data from a remote host.

Zabbix sender – command‑line tool to push data to the server or proxy.

Default Ports

Server (zabbix_server) uses port 10051.

Client agent (zabbix_agent2) uses port 10050.

Installing Zabbix

zabbix-server  192.168.50.105 zabbix-server-mysql、zabbix-agent
zabbix-agent   192.168.50.110 zabbix-agent2

Deploy Zabbix Server (Port 10051)

Minimum 2 GB RAM, 4 GB recommended. Install both zabbix-server-mysql and zabbix-agent on the server host because the server itself also needs monitoring.

# Disable firewall
systemctl disable --now firewalld
setenforce 0
hostnamectl set-hostname zbx-server

# Add Zabbix repository (Aliyun mirror)
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
cd /etc/yum.repos.d
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' zabbix.repo

yum clean all && yum makecache

yum install -y zabbix-server-mysql zabbix-agent

# Install SCL for newer PHP (>=7.2)
yum install -y centos-release-scl

# Install Zabbix web front‑end in SCL environment
# (repository configuration omitted for brevity)

yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl

# Install MariaDB
yum install -y mariadb-server mariadb
systemctl enable --now mariadb
mysql_secure_installation   # set root password, e.g., abc123

# Create Zabbix database and user
mysql -u root -pabc123 <<EOF
CREATE DATABASE zabbix character set utf8 collate utf8_bin;
GRANT ALL ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
FLUSH PRIVILEGES;
EOF

# Import initial schema
zcat /usr/share/doc/zabbix-server-mysql-5.0.15/create.sql.gz | mysql -uroot -pabc123 zabbix

# Configure server DB password
sed -i 's/^# DBPassword=/DBPassword=zabbix/' /etc/zabbix/zabbix_server.conf

# Adjust PHP timezone
sed -i 's/^# php_value\[date.timezone\].*/php_value[date.timezone] = Asia\/Shanghai/' /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

# Start services
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

# Access web UI: http://192.168.50.105/zabbix (default login: Admin / zabbix)

# Fix Chinese characters in web UI
yum install -y wqy-microhei-fonts
cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

Deploy Zabbix Client (Port 10050)

Zabbix 5.0 uses a new Go‑based client zabbix_agent2. The server uses port 10051, the client uses 10050.

# Disable firewall and set hostname
systemctl disable --now firewalld
setenforce 0
hostnamectl set-hostname zbx-agent01

# Install NTP for time sync
yum install -y ntpdate
ntpdate -u ntp.aliyun.com

# Set timezone to match server
mv /etc/localtime{,.bak}
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# Add Zabbix repository and install agent2
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
cd /etc/yum.repos.d
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' zabbix.repo

yum install -y zabbix-agent2

# Configure agent2
vim /etc/zabbix/zabbix_agent2.conf   # set Server and ServerActive to 192.168.50.105, Hostname to zbx-agent01

# Start and enable agent2
systemctl start zabbix-agent2
systemctl enable zabbix-agent2

# Verify listening port
netstat -natp | grep zabbix

# Test connectivity from server
yum install -y zabbix-get
zabbix_get -s '192.168.50.110' -p 10050 -k 'agent.ping'
zabbix_get -s '192.168.50.110' -p 10050 -k 'system.hostname'

After completing the above steps, both the Zabbix server and agent are operational, and you can begin adding hosts, configuring items, triggers, and actions through the web interface.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

monitoringLinuxopen‑sourceZabbixserver deploymentagent configuration
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.