Overview
Zabbix là phần mềm mã nguồn mở sử dụng để giám sát hệ thống với nhiều công cụ hỗ trợ mạnh mẽ. Zabbix chạy trên mô hình client/server gồm Zabbix Server là nơi tập trung, phân tích, hiển thị. Zabbix Client là thu thập dữ liệu trên host để đưa về cho Zabbix Server
Mô hình
Bài viết được cấu hình theo sơ đồ sau
Mục lục
- Các thành phần của Zabbix Server
- Hướng dẫn cài đặt
Hướng dẫn xây dựng
1. Các thành phần của Zabbix Server
- Zabbix Server: là trung tâm xử lý mọi tiến trình
- Database sử dụng MariaDB, MySQL, PostgressSQL để lưu trữ dữ liệu thu thập được
- Zabbix frontend là giao diện web, bản điều khiển, hiển thị dành cho người dùng
- …
2. Hướng dẫn cài đặt
- Tắt firewall trên server
sudo systemctl disable firewalldsudo systemctl stop firewalldsed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
sudo setenforce 0- Cài đặt các gói hỗ trợ database MySQL
yum update -yyum install php php-devel php-bcmath php-pear php-gd php-mbstring php-mysql php-xml -y- Cài đặt MySQL
yum install wgetwget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum install mysql-server -ysystemctl start mysqldsystemctl enable mysqld
- Đặt mật khẩu cho user root của MySQL
mysql_secure_installation <<EOF- Login vào database
mysql -u root -p- Tạo database, tạo user và phân quyền cho user đó
CREATE DATABASE zabbix CHARACTER SET UTF8 COLLATE UTF8_BIN;CREATE USER 'zabbix'@'%' IDENTIFIED BY 'passla123';GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%';quit;- Cài đặt Zabbix Server
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpmyum install zabbix-server-mysql -yyum install zabbix-web-mysql -y- Import database Zabbix nếu sử dụng MySQL
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix- Cấu hình database trong file /etc/zabbix/zabbix_server.conf
DBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=passla123- Chỉnh sửa các tham số cho Web interface trong file /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300php_value max_input_vars 10000php_value always_populate_raw_post_data -1php_value date.timezone Asia/Ho_Chi_Minh- Khởi động lại các dịch vụ
systemctl restart zabbix-serversystemctl restart httpdsystemctl enable zabbix-server httpd- Truy cập vào giao diện web của Zabbix bằng địa chỉ http://IP_Server_Zabbix/zabbix -> Nhấn Next step

- Kiểm tra các thành phần đã OK hết chưa -> Nhấn Next step

- Cấu hình để Zabbix kết nối tói database
- Ở phần Database type: Chọn loại database mà bạn đã cài trên Zabbix server
- Ở phần Database name: Nhập tên của database mà bạn đã tạo trước đó
- Ở phần User: Nhập user mà bạn đã tạo trong database
- Ở phần Password: Nhập pass của user mà bạn đã tạo trong database
-> Nhấn Next step

- Đặt tên cho Zabbix Server trên giao diện web -> Nhấn Next step

- Nhấn Finish để hoàn thành -> Giao diện quản trị của Zabbix

- Tài khoản Zabbix server là Admin/zabbix
 
							 
							