Step-by-Step Guide to Installing Zabbix 5 on CentOS 7
This article provides a comprehensive, hands‑on tutorial for installing and configuring Zabbix 5 on CentOS 7, covering system overview, key terminology, disabling SELinux and firewalls, setting up repositories, installing server, agent, frontend, MariaDB, database initialization, configuration tweaks, and final web‑UI setup.
System Overview
Zabbix is an enterprise‑grade monitoring solution that supports real‑time monitoring of thousands of servers, virtual machines, and network devices, collecting millions of metrics.
Main features include:
Metric collection from any device, system, or application.
Problem detection with intelligent thresholds.
Unified visual management interface.
Timely and effective alerting and remediation.
Security and authentication for all data layers.
Easy deployment with many ready‑to‑use templates.
Automatic discovery for large dynamic environments.
Distributed monitoring with unlimited scalability.
Key Terminology
Host : a server, workstation, switch or any network device you want to monitor, identified by IP or hostname.
Host group : a collection of hosts sharing a common role or attribute, e.g., all Windows servers.
Item : the specific data you want to collect from a host or host group, such as CPU usage.
Trigger : a logical expression that evaluates collected data against predefined thresholds, producing a "Problem" or "OK" state.
Event : a single occurrence that requires attention, such as a trigger changing state.
Action : a predefined operation executed automatically when an event occurs, e.g., running a reboot command when CPU exceeds 80%.
Zabbix server : the core daemon that communicates with agents, evaluates triggers, sends alerts, and stores data.
Zabbix agent : a lightweight program installed on monitored hosts that gathers local metrics.
Installation Steps
1. Disable SELinux and the firewall
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config systemctl disable --now firewalld reboot2. Install the Zabbix RPM repository
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
yum clean all3. Install Zabbix server and agent
yum install zabbix-server-mysql zabbix-agent -y4. Install the Zabbix frontend
yum install centos-release-scl -y vi /etc/yum.repos.d/zabbix.repo # set "enabled=1" for the frontend repo yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y5. Install MariaDB
yum install mariadb-server -y systemctl enable --now mariadb mysql_secure_installation6. Configure the Zabbix database
mysql -u root -p # enter the root password create database zabbix default character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by "zabbix_pwd"; zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix7. Final Zabbix configuration and web UI installation
vi /etc/zabbix/zabbix_server.conf # set DBPassword to the Zabbix DB password vi /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf # set php_value[date.timezone] = Asia/Shanghai systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpmOpen a browser and navigate to http:// IP /zabbix to continue the web installation.
Follow the wizard: click “Next step”, verify that all environment checks are OK, configure the database connection (host, name, password, default port 3306), accept the default server settings, and finish the installation.
After completion, log in with the default credentials (user: Admin , password: zabbix ).
Configure Chinese language
In the lower‑left “User settings”, set Language to Chinese (zh_CN) .
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.