You are on page 1of 5

Dịch vụ giám sát Zabbix

Cài đặt httpd


yum -y install httpd
systemctl start httpd.service
systemctl enable httpd
Cài đặt zabbix
Cài đặt epel và remi repos
yum -y install epel-release -y
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
disable PHP 5 repositories và enable PHP 7.2 repo
yum-config-manager --disable remi-php54
yum-config-manager --enable remi-php72
Cài đặt PHP
yum install php php-pear php-cgi php-common php-mbstring php-snmp php-gd
php-pecl-mysql php-xml php-mysql php-gettext php-bcmath -y
Chỉnh sửa time Zone PHP tại file php.ini
vi /etc/php.ini
dòng 904
date.timezone = Asia/Ho_Chi_Minh
Cài đặt MariaDB
yum -y install mariadb-server
Start MariaDB
systemctl start mariadb.service
systemctl enable mariadb

mysql_secure_installation

mysql_secure_installation

Tạo Database cho Zabbix
thực hiện chạy các lệnh sau sau khi đăng nhập vào DB server
mysql -u root -p
Enter password:

MariaDB [(none)]> create database zabbix CHARACTER SET UTF8 COLLATE


UTF8_BIN; ## lệnh tạo DB có tên là zabbix
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user 'zabbixuser'@'localhost' identified BY 'abc@123';


## Tạo User DB
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbixuser@localhost; ##


Gán quyền DB với DB User
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;


Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> quit;
Bye

Thêm Zabbix repository bằng cách copy lệnh bên dưới và chạy
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-
1.el7.noarch.rpm
Cài đặt Zabbix
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get -y
Install Zabbix Centos OS

Configure Zabbix
Thay đổi Time Zone trong cấu hình Zabbix Apache:
/etc/httpd/conf.d/zabbix.conf và sửa như sau.

php_value date.timezone Asia/Ho_Chi_Minh


Install Zabbix Centos OS

Restart lại httpd


systemctl restart httpd.service
cd /usr/share/doc/zabbix-server-mysql-4.0.16 và import MySQL.

zcat create.sql.gz | mysql -u zabbixuser -p zabbix

vi /etc/zabbix/zabbix_server.conf
Dòng 91, 100, 116, 125
DBHost=localhost
DBName= zabbix
DBUser=zabbixuser
DBPassword=abc@123
systemctl start zabbix-server.service
systemctl enable zabbix-server.service
systemctl restart zabbix-server.service

firewall-cmd --add-service={http,https} --permanent


firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
firewall-cmd --reload
systemctl restart httpd

 Truy cập
 http://ip/zabbix hoặc http://server-host-name/zabbix

Trên Client linux:


yum -y install http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/
yum -y install zabbix-agent
vi /etc/zabbix/zabbix_agentd.conf
Trên windows:
Download https://www.zabbix.com/download_agents

You might also like