Hướng dẫn cài đặt ZABBIX 6.2 trên Ubuntu 22

Zabbix là công cụ giám sát hệ thống và mạng nguồn mở, hỗ trợ giám sát hiệu suất và tình trạng của máy chủ, dịch vụ, và tài nguyên IT. Nó cung cấp cảnh báo thời gian thực, báo cáo, và dự báo hiệu suất, qua một giao diện web dễ sử dụng. Lý tưởng cho việc quản lý tập trung tài nguyên IT một cách hiệu quả.

Bước 1 - Cài đặt Apache web server, PHP và MySQL database

1.  Cài đặt Apache2 service.

apt-get install apache2 -y

2. Cài đặt MySQL database.

apt-get install mysql-server -y

4. Install PHP.

apt-get install php php-pear php-cgi php-common libapache2-mod-php php-mbstring php-net-socket php-gd php-xml-util php-mysql php-bcmath -y

Bước 2 - Download and Install Zabbix 6.2 in Ubuntu 22

1. Download the Zabbix Repository cho Ubuntu sử dụng wget.

wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-2%2Bubuntu22.04_all.deb

2. Cài đặt repository sử dụng dpkg tool.

dpkg -i zabbix-release_6.2-2+ubuntu22.04_all.deb

4. Tìm nạp phiên bản mới nhất của danh sách package.

apt-get update

5. Cài đặt Zabbix Server, Frontend và Agent.

apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y

Bước 3 - Cấu hình Database

1. Truy cập MySQL bằng cách sử dụng command.

mysql

2. Chạy các lệnh sau để tạo database, user và password database.

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

 3. Trên Zabbix server các bạn imports theinitial schema và data bằng lệnh.

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Nhập mật khẩu khi được yêu cầu:



4. Disable the log_bin_trust_function_creators option after importing the database schema.

# mysql
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

Bước 4 - Configure the Zabbix server and start the server processes

1. Edit  file cấu hình Zabbix  /etc/zabbix/zabbix_server.conf.

vi /etc/zabbix/zabbix_server.conf

2. Bỏ comment DBPassword và nhập Zabbix database password:

DBPassword=password

3. Start the Zabbix server và agent processes, và set autostart khi system boot.

systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2

4. Install language packs cho Zabbix.

apt-get install language-pack-en

Bước 5 - Set up Zabbix monitoring tool

1. Truy cập vào web browser theo link như vứ dụ sau http://IPaddress/zabbix/setup.php, 111.111.111.111

http://111.111.111.111/zabbix/setup.php

2. Next cho tới khi hệ thống yêu cầu nhập MySQL-Zabbix database password.

3. Log in vào Zabbix sử dụng http://111.111.111.111/zabbix/

Default Username: Admin
Default Password: zabbix

Chúc các bạn thành công.

Bình luận