Take-note: step by step how to install Zabbix-Server.
Zabbix - Easy Steps for Installation and Configuration:
This is my topo:
Part 01 of IT Infrastructure Monitoring with Zabbix. In this article:
- server01: Zabbix
- server02: MySQL
Let's go!
# server01
vim /etc/hosts
Add this:
172.16.2.201 vnsmysql01.infra.lecuong.info
172.16.2.203 vnszabbix01.infra.lecuong.info
Add the Zabbix Repository:
Zabbix v6
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-latest.el9.noarch.rpm
Zabbix v7
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest.el9.noarch.rpm
Install Zabbix Server, Frontend, and Agent:
sudo dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
dnf install zabbix-sql-scripts
mysql -u root -p
CREATE DATABASE zabbixv6 CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'admindbzabbixvn'@'%' IDENTIFIED BY 'XXX';
GRANT ALL PRIVILEGES ON zabbix.* TO 'admindbzabbixvn'@'%';
FLUSH PRIVILEGES;
SET GLOBAL log_bin_trust_function_creators = 1;
EXIT;
gunzip /usr/share/zabbix-sql-scripts/mysql/server.sql.gz
mysql -u admindbzabbixvn -p XXX < server.sql
sudo vim /etc/zabbix/zabbix_server.conf
Add this:
DBHost=vnsmysql01.infra.lecuong.info
DBName=zabbix
DBUser=admindbzabbixvn
DBPassword=XXX
CacheSize=512M
sudo vim /etc/httpd/conf.d/zabbix.conf (if need)
echo "Configuring PHP for Zabbix frontend..."
sudo sed -i 's/;max_execution_time = 30/max_execution_time = 300/' /etc/php.ini
sudo sed -i 's/;memory_limit = 128M/memory_limit = 1024M/' /etc/php.ini
firewall-cmd --permanent --zone=public --add-port=10050/tcp
firewall-cmd --permanent --zone=public --add-port=10051/tcp
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --reload
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
sudo systemctl start httpd
sudo systemctl enable httpd