IT Infrastructure Monitoring with Zabbix - Part01

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

# server02 (

Create mysql-user(*)


	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;
	
(*) 'xxx' is your-password  


Import the Initial Schema and Data:

**Import the schema:(*)

	gunzip /usr/share/zabbix-sql-scripts/mysql/server.sql.gz 
	mysql -u admindbzabbixvn -p XXX < server.sql
	

(*)Copy /usr/share/zabbix-sql-scripts/mysql/server.sql.gz from server01 to server02:/tmp/  (if need)

# server01

* Configure Zabbix Server:


		sudo vim /etc/zabbix/zabbix_server.conf
        
Add this:

		DBHost=vnsmysql01.infra.lecuong.info
		DBName=zabbix
		DBUser=admindbzabbixvn
		DBPassword=XXX
		CacheSize=512M
	

* Configure PHP for Zabbix Frontend:  on server01

** Edit the PHP configuration to adjust settings like max_execution_time and memory_limit. Open the Zabbix configuration file:


		sudo vim /etc/httpd/conf.d/zabbix.conf (if need) 

# Configure PHP for Zabbix frontend

        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
		

# Open Ports  

	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
	

# Start all services


		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
		

---------------------------------------
Access: http://vnszabbix01.infra.lecuong.info/zabbix

--> Login: Admin/zabbix

------- notes -----------
Zabbix Server web: TCP/80 ?443
Zabbix Server to Zabbix Agent: TCP/10050
Zabbix Agent to Zabbix Server: TCP/10051

Shell Script to install MariaDB on Linux




Viết nhận xét

Các bạn có thể viết lời nhận xét cho bài viết, nhưng cần tuân thủ một số quy tắc sau:

» Các nhận xét/bình luận phải nghiêm túc, không dung tục, không spam.
» Nội dung phải liên quan tới chủ đề bài viết.
» Viết bằng tiếng việt có dấu hoặc tiếng Anh. Nội dung viết không dấu sẽ bị xóa.
» Hãy để lại tên của bạn khi nhận xét/bình luận, để tôi có thể dễ dàng trả lời bạn khi cần.