CentOS-7 compile and install zabbix5.0 (proxy side)

CentOS-7 compile and install zabbix5.0 (proxy side)

1. Prepare the environment

zabbix-prxoy is a proxy server, it collects the monitored data, first stores the database, and then transmits it to zabbix-server; so the proxy needs a separate database

The role of zabbix-prxoy:

1. When there are too many monitoring devices, it is used to share zabbix-server monitoring pressure

2. For different network environments, distributed monitoring can be formed

2. Install zabbix-proxy

yum install -y zabbix-proxy

3. Test to open the service

systemctl start zabbix-proxy

Note: be sure to turn off zabbix-agent

4. Install mysql

yum install -y mariadb-server
systemctl start mariadb
systemctl enable mariadb

5. Create a database and authorize

mysql [(none)]>create database zabbix_proxy default charset utf8;
Query OK, 1 row affected (0.01 sec)

mysql [(none)]>grant all on zabbix_proxy.* to [email protected]'localhost' identified by 'zabbix_proxy
';Query OK, 0 rows affected (0.00 sec)

6. Import data

/usr/share/doc/zabbix-proxy-mysql-5.0.12在这个文件下有一个schema.sql.gz

zcat schema.sql.gz | mysql -uzabbix_proxy -p zabbix_proxy

7. Configure proxy to connect to the database

[[email protected] ~]# vim /etc/zabbix/zabbix_proxy.conf 修改
[[email protected] ~]# grep '^[a-Z]' /etc/zabbix/zabbix_proxy.conf 
Server=192.168.211.141			指向zabbix-server
Hostname=sc_proxy				proxy代理名
DBName=zabbix_proxy				连接的数据库名称
DBUser=zabbix_proxy				使用的用户
DBPassword=zabbix_proxy			密码

8. Restart the service

systemctl restart zabbix-proxy
systemctl status zabbix-proxy

9. Point the agent to the proxy

Server=192.168.211.150
重启agent

10, wed configuration

[External link image transfer failed. The source site may have an anti-hotlinking mechanism. It is recommended to save the image and upload it directly (img-3iDjg9Ve-1623077712857)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\ image-20210607121356036.png)]
[External link image transfer failed. The source site may have an anti-hotlinking mechanism. It is recommended to save the image and upload it directly (img-Wu30oPJo-1623077712864)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\ image-20210607121659047.png)]
[External link image transfer failed. The source site may have an anti-hotlinking mechanism. It is recommended to save the image and upload it directly (img-92qpcGnw-1623077712867)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\ image-20210607122521497.png)]
[External link image transfer failed. The source site may have an anti-hotlinking mechanism. It is recommended to save the image and upload it directly (img-KgBVmbm4-1623077712874)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\ image-20210607222949826.png)]