Zabbix-server应用
Zabbix Proxy适用于大规模分布式监控场景,采用的一种分担Server端压力的分层结构,Proxy只负责一定区域内的数据采集工作,然后定期将数据一次性发送给Server,极大的减轻了Server的负载压力,使得可以支持更大规模的监控需求。
实验图:
Zabbix-server 端的配置参考:
http://fengxiaoli.blog.51cto.com/12104465/1954649
Zabbix-proxy配置
[[email protected]_proxy ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
[[email protected]_proxy ~]# yum install -y zabbix-proxy zabbix-proxy-mysql mysql-server
[[email protected]_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;
[[email protected] ~]# grep "^[a-Z]" /etc/zabbix/zabbix_proxy.conf
ProxyMode=0 #主动模式
Server=192.168.10.129 # server端ip
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
[[email protected] ~]# /etc/init.d/zabbix-proxy start
Zabbix-agent端配置
[[email protected] ~]# 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/
[[email protected] ~]# /etc/init.d/zabbix-agent restart
[[email protected] ~]# /etc/init.d/zabbix-proxy restart
网页端配置
添加proxy1
添加一个主机同时把该主机添加到proxy1
测试:由于agent端和proxy端都用的主动模式,灯没有亮,但数据已经监控到