美文网首页
zabbix分布式监控proxy

zabbix分布式监控proxy

作者: zwb_jianshu | 来源:发表于2019-08-10 13:21 被阅读0次

环境规划:

10.0.0.61    zabbix-server
10.0.0.100  172.16.1.100 zabbix- proxy
172.16.1.12  zabbix-agent

1)在100上配置zabbix repo

[root@sh-proxy ~]# rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm 
[root@sh-proxy ~]# wget https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-proxy-mysql-4.0.9-3.el7.x86_64.rpm

2)安装zabbix-proxy

[root@sh-proxy ~]# yum install zabbix-proxy-mysql -y 
[root@sh-proxy ~]# yum localinstall zabbix-proxy-mysql-4.0.9-3.el7.x86_64.rpm -y

3)配置zabbix-proxy

a:安装并启动mariadb 
[root@sh-proxy ~]# yum install mariadb -y 
b:创库授权,并导入数据 
[root@zabbix-server ~]# mysql
create database zabbix_proxy;
grant all on zabbix_proxy.* to zabbix@'10.0.0.100' identified by '123456';
[root@sh-proxy ~]# rpm -ql zabbix-proxy-mysql |grep  "sql"
/usr/share/doc/zabbix-proxy-mysql-4.0.9/NEWS
/usr/share/doc/zabbix-proxy-mysql-4.0.9/README
/usr/share/doc/zabbix-proxy-mysql-4.0.9/schema.sql.gz
[root@sh-proxy ~]# cd /usr/share/doc/zabbix-proxy-mysql-4.0.9/
[root@sh-proxy zabbix-proxy-mysql-4.0.9]# zcat schema.sql.gz|mysql -uzabbix -p123456 -h 10.0.0.61 zabbix_proxy
c:修改zabbix-proxy配置文件 
[root@sh-proxy ~]# grep -Ev "#|^$"  /etc/zabbix/zabbix_proxy.conf 
Server=10.0.0.61
Hostname=sh-proxy
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
SocketDir=/var/run/zabbix
DBHost=10.0.0.61
DBName=zabbix_proxy
DBUser=zabbix
DBPassword=123456
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

4)启动zabbix-proxy

systemctl restart zabbix-proxy.service
systemctl enable zabbix-proxy.service 

5)配置zabbix-agent

[root@sh-proxy zabbix-proxy-mysql-4.0.9]# ssh root@172.16.1.12
[root@zabbix01 ~]# grep -Ev "#|^$" /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=172.16.1.100
ServerActive=172.16.1.100
Hostname=172.16.1.12
Include=/etc/zabbix/zabbix_agentd.d/*.conf

6)启动zabbix-agent

systemctl restart zabbix-agent.service
systemctl enable zabbix-agent.service

7)配置zabbix-proxy


image.png image.png

8)链接主机zabbix-proxy

image.png image.png image.png

相关文章

网友评论

      本文标题:zabbix分布式监控proxy

      本文链接:https://www.haomeiwen.com/subject/tjcrjctx.html