环境:
linux-node1.example.com CentOS release 6.7 zabbix-sender-3.0.31-1.el6.x86_64
linux-node1.example.com CentOS release 6.7
zabbix proxy可以代替zabbix server检索客户端的数据,然后把数据汇报给zabbix server,并且在一定程度上分担了zabbix server的压力.zabbix proxy可以非常简便的实现了集中式、分布式监控.
安装java和mysql在node2上
[root@linux-node2 ~]# yum install -y java-1.8.0
[root@linux-node2 ~]# yum install -y mysql mysql-server zabbix-proxy-mysql
准备一个tomcat
[root@linux-node2 zabbix]# vim zabbix_proxy.conf
Server=10.0.0.15
Hostname=linux-node2.example.com
DBHost=l0.0.0.16
DBName=zabbix_proxy —mysql的账户,密码,和数据库名
DBUser=zabbix_proxy
DBPassword=zabbix_proxy
[root@linux-node2 zabbix]# service mysqld start
[root@linux-node2 zabbix]# mysql_secure_installation
[root@linux-node2 zabbix]# mysql -u root –pzabbix
mysql> create database zabbix_proxy character set utf8 collate utf8_bin;
mysql> grant all on zabbix_proxy.* to zabbix_proxy@10.0.0.16 identified by 'zabbix_proxy';
[root@linux-node2 zabbix]# mysql -h 10.0.0.16 -u zabbix_proxy -pzabbix_proxy
[root@linux-node2 zabbix]# rpm -ql zabbix-proxy-mysql —看软件安装地址
[root@linux-node2 zabbix]# cd /usr/share/doc/zabbix-proxy-mysql-3.0.31/
[root@linux-node2 zabbix-proxy-mysql-3.0.31]# zcat schema.sql.gz | mysql -h 10.0.0.16 -uzabbix_proxy -pzabbix_proxy zabbix_proxy
验证下配置文件
[root@linux-node2 zabbix-proxy-mysql-3.0.31]# grep ‘1’ /etc/zabbix/zabbix_proxy.conf
Server=10.0.0.15
Hostname=linux-node2.example.com
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
DBName=zabbix_proxy
DBUser=zabbix_proxy
DBPassword=zabbix_proxy
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
[root@linux-node2 ~]# service zabbix-proxy start
Starting Zabbix proxy: [ OK ]
[root@linux-node2 zabbix]# netstat –lntp
在网页上创建代理
[root@linux-node2 zabbix]# vim /etc/zabbix/zabbix_agentd.conf
ServerActive=10.0.0.15,10.0.0.16
Server=10.0.0.16
Hostname=linux-node2.example.com
[root@linux-node2 zabbix]# service zabbix-agent restart
Shutting down Zabbix agent: [ OK ]
Starting Zabbix agent: [ OK ]
a-Z ↩︎