Zabbix-server应用

Zabbix Proxy适用于大规模分布式监控场景,采用的一种分担Server端压力的分层结构,Proxy只负责一定区域内的数据采集工作,然后定期将数据一次性发送给Server,极大的减轻了Server的负载压力,使得可以支持更大规模的监控需求。

wKioL1mMdA-Q8NU8AAEAQKaTVu0265.png



实验图:

wKiom1mMdBCDSbCIAAAPSE6IyBM014.png


Zabbix-server 端的配置参考:

http://fengxiaoli.blog.51cto.com/12104465/1954649

Zabbix-proxy配置

[root@zabbix_proxy ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

[root@zabbix_proxy ~]# yum install -y zabbix-proxy zabbix-proxy-mysql mysql-server

[root@zabbix_proxy ~]#  /etc/init.d/mysqld start

mysql> create database zabbix_proxy character set utf8;

mysql>  CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbix';

mysql>  GRANT ALL ON zabbix_proxy.* TO 'zabbix'@'localhost';

mysql>  use zabbix_proxy;

mysql>  source /usr/share/doc/zabbix-proxy-mysql-2.4.8/create/schema.sql;

mysql> flush privileges;

 

[root@proxy1 ~]# grep "^[a-Z]" /etc/zabbix/zabbix_proxy.conf

ProxyMode=0       #主动模式

Server=192.168.10.129    # serverip

Hostname=proxy1         #如果有多个proxy不要重复

LogFile=/var/log/zabbix/zabbix_proxy.log

LogFileSize=0

PidFile=/var/run/zabbix/zabbix_proxy.pid

DBName=zabbix_proxy

DBUser=zabbix

DBSocket=/var/lib/mysql/mysql.sock

ExternalScripts=/usr/lib/zabbix/externalscripts

 

[root@proxy1 ~]# /etc/init.d/zabbix-proxy start

 

Zabbix-agent端配置

[root@linux-node1 ~]# grep "^[a-Z]" /etc/zabbix/zabbix_agentd.conf

PidFile=/var/run/zabbix/zabbix_agentd.pid

LogFile=/var/log/zabbix/zabbix_agentd.log

LogFileSize=0

ServerActive=192.168.10.133    #这里把地址指向proxy

Hostname=linux-node1.example.com

Include=/etc/zabbix/zabbix_agentd.d/

[root@linux-node1 ~]# /etc/init.d/zabbix-agent restart

[root@proxy1 ~]# /etc/init.d/zabbix-proxy restart

网页端配置

添加proxy1

wKiom1mMdBDDmO29AAB0A_F8aw0006.png

wKiom1mMdCezBUSJAABfik9IZCI722.png

添加一个主机同时把该主机添加到proxy1

wKiom1mMdCjyFQMCAAB9T5Fafb8758.png

wKiom1mMdCjhnkysAAB2asiOADM609.png

wKiom1mMdCiA2W-_AAAneCpjoIw439.png

wKiom1mMdCny6L40AABRWvHlBbg350.png

 

测试:由于agent端和proxy端都用的主动模式,灯没有亮,但数据已经监控到


wKiom1mMdCrzs7D7AADH5yRfVJo299.png

wKiom1mMdQ6zuNnrAADEgJ9hujQ352.png