Distributed Monitoring
Role: share the burden, reduce the load, multi-room monitoring
, Zabbix server can be acquired by remote proxy built from ZABBIX proxy data, the environment here corresponds zabbix server having a public network address ip, zabbix agent has only the network address, having an outer ZABBIX proxy network address and network address, set up ZABBIX proxy so zabbix server through the remote proxy data acquired zabbix agent
Deployment Readiness:
zabbix server 192.168.175.102
zabbix proxy 192.168.175.111
zabbix agent 192.168.175.112
Command: iptables -F # Clear firewall rules
Command: systemctl stop firewalld # turn off the firewall
Command: setenforce 0 # selinux closed
1. Configure zabbix proxy
Command: rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm # zabbix proxy install dependencies
命令:yum -y install zabbix-proxy-mysql
2. Configuration Database
zabbix proxy also requires a database, the database is not used to store monitoring data is only used to store configuration information
(1) installation of the database
命令:yum -y install mariadb-server
Command: systemctl start mariadb.service # start
(2) establishment of a database
命令:create database zabbix_proxy character set utf8 collate utf8_bin;
命令:grant all privileges on zabbix_proxy.* to zabbix@'localhost' identified by 'zabbix';
(3) import data files
命令:zcat /usr/share/doc/zabbix-proxy-mysql-3.0.28/schema.sql.gz |mysql -uzabbix -pzabbix zabbix_proxy
(4) arranged zabbix proxy connection database
Command: sed -i.ori '162a DBPassword = zabbix' /etc/zabbix/zabbix_proxy.conf # modify the database connection password zabbix
Command: sed -i 's # Server = 127.0.0.1 # Server = 192.168.175.102 #' /etc/zabbix/zabbix_proxy.conf # specify the server IP
Command: sed -i 's # Hostname = Zabbix proxy # Hostname = localhost #' /etc/zabbix/zabbix_proxy.conf # zabbix-proxy host name specified
Note: Hostname as the name of the agent added later, to be consistent
Note: I do not have to modify the host name, it uses localhost
(5) to restart the database
命令:systemctl restart zabbix-proxy.service
命令:systemctl restart mariadb.service
(6) inspection port
Command: ss -antulp | grep zabbix
3.web interface Add Agent
Management ---------> agent agent --------> Create Agent
Now the proxy server has been deployed, and then do one client, to test
1. Installation proxy agent configured to point
192.168.175.102是zabbix服务端
192.168.175.111是zabbix代理服务端
192.168.175.112是zabbix客户端,将客户端加入到zabbix代理服务端上面
命令:rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
命令:wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-agent-3.0.18-1.el7.x86_64.rpm
注意:两种链接任选一种,都能下载客户端
命令:yum -y install zabbix-agent #安装客户端
命令:grep ^Server /etc/zabbix/zabbix_agentd.conf #查看客户端配置文件里指定的服务端IP
Server=127.0.0.1
ServerActive=127.0.0.1
命令:sed -i 's#127.0.0.1#192.168.175.111#g' /etc/zabbix/zabbix_agentd.conf #指定代理服务端IP
命令:grep ^Server /etc/zabbix/zabbix_agentd.conf
Server=192.168.175.111
ServerActive=192.168.175.111
命令:systemctl restart zabbix-agent.service #重启客户端
2.server端的web界面添加主机
配置——>主机——>创建主机
主机名称和agent端配置文件中相同,选择代理
为主机添加模板
3、检验
等待添加的主机变绿,变绿之后查看最新数据
若不能及时变绿,则需要重启服务或在服务端使用命令zabbix_server -R config_cache_reload刷新配置缓存
在主机里可以找到,这样就配置完成了
总结:。。。。。。。。。。。此处省略一万字