zabbix use proxy distributed monitoring

Schematic:

Outline

zabbix proxy time may be replaced zabbix server collects performance and availability of data and the data reported to zabbix server, and share the pressure zabbix server to some extent. In addition, all the data are concentrated and collected at all agents and proxies reported to a Zabbix server and use of proxy is the easiest way to achieve centralized and distributed monitoring.

zabbix proxy usage scenarios:

  1. Remote monitoring equipment area

  2. Monitor local area network instability

  3. When zabbix monitoring thousands of devices, use it to reduce the pressure on the server

Address planning

 

CPU name service External network ip Network ip
zabbix-server zabbix-server 10.0.0.71  
zabbix-agent zabbix-agent   172.16.1.7
zabbix-proxy zabbix-proxy 10.0.0.8 172.16.1.8

NOTE: 10.0.0.7 and 10.0.0.8 In one LAN segment, but can not connect zabbix-agent xshell

Installation proxy

Version 4.0 update source

Tsinghua 4.0 Source Address: https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/

1 $ wget HTTPS: // mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm 
2 $ RPM -ivh zabbix-Release - 4.0 - 2 .el7.noarch.rpm
 . 3  
. 4  # change Tsinghua source
 . 5 Vim / etc / yum .repos.d / zabbix.repo
 . 6  # line mode
 . 7 % S # HTTP: // repo.zabbix.com # https://mirrors.tuna.tsinghua.edu.cn/zabbix #G

zabbix-proxy installation ideas:

  1. 4.0 zabbix yum source

  2. Installation zabbix-proxy-mysql service

  3. Creating zabbix_proxy, import database

  4. Start zabbix-proxy

  5. Add proxy on zabbix-web

Installation proxy

1 [root@zabbix-proxy ~]# yum install zabbix-proxy-mysql.x86_64 -y 

Create a database

1 MariaDB [(none)]> create database zabbix_proxy charset utf8;
2 Query OK, 1 row affected (0.00 sec)
3 MariaDB [(none)]> grant all on zabbix_proxy.* to  zabbix@localhost  identified by '123456';
4 Query OK, 0 rows affected (0.00 sec)

Import Database

. 1 $ RPM ZABBIX the -ql PROXY- MySQL
 2 / usr / Share / DOC / ZABBIX-PROY-MySQL- 4.0 . . 17 /schema.sql.gz - this is a compressed package
 . 3  
. 4  # into the database
 . 5 $ zcat   / usr / Share / DOC / ZABBIX-Proxy-MySQL- 4.0 . . 17 /schema.sql.gz | MySQL -uzabbix -p123456 zabbix_proxy

Configuration database

Profiles /etc/zabbix/zabbix_proxy.conf

. 1 $ Vim / etc / ZABBIX / zabbix_proxy.conf 
 2   30 Server = 10.0 . 0.71      - connect to the database
 . 3   49 the Hostname = bj_proxy - each proxy name can not be the same 
 . 4  196 DBPassword = 123456     - database password
 . 5  
. 6  
. 7 $ systemctl Start zabbix- proxy.service
 8 $ systemctl enable zabbix-proxy.service

proxy add to zabbix

zabbix-agent configuration

Modify the configuration file

1 $ vim /etc/zabbix/zabbix-agent.conf
2 
3 #将Server更改为proxy的IP地址
4 98 Server=172.16.1.8
5 139 ServerActive=172.16.1.8
6 150 Hostname=172.16.1.7
7 169 HostMetadata=web
8 $ systemctl restart  zabbix-agent.service

查看结果

 

Guess you like

Origin www.cnblogs.com/Mercury-linux/p/12289755.html