环境:Centos 6.6
[root@Proxy ~]# yum -y install mysql-server[root@Proxy ~]# /etc/init.d/mysqld start[root@Proxy ~]# chkconfig mysqld on[root@Proxy ~]# /usr/bin/mysqladmin -u root password 'redhat'[root@Proxy ~]# mysql -uroot -predhatmysql> CREATE DATABASE zabbix_proxy CHARACTER SET utf8;mysql> GRANT ALL ON zabbix_proxy.* TO 'zabusr'@'192.168.31.%.%' IDENTIFIED BY 'zbxproxy';mysql> GRANT ALL ON zabbix_proxy.* TO 'zabusr'@'localhost' IDENTIFIED BY 'zbxproxy';mysql> FLUSH PRIVILEGES;
[root@Proxy rpm]# yum -y install zabbix-2.0.14-1.el6.x86_64.rpm zabbix-proxy-2.0.14-1.el6.x86_64.rpm zabbix-proxy-mysql-2.0.14-1.el6.x86_64.rpm[root@Proxy rpm]# rpm -ql zabbix-proxy-mysql[root@Proxy rpm]# mysql -uzabusr -pzbxproxy zabbix_proxy < /usr/share/doc/zabbix-proxy-mysql-2.0.14/create/schema.sql[root@Proxy rpm]#
[root@Proxy rpm]# cd /etc/zabbix/[root@Proxy ~]# grep -v ^# /etc/zabbix/zabbix_proxy.conf |grep -v ^$Server=192.168.31.130Hostname=Proxy.example.com //这里必须和Zannix WEB gui上保持一直(DM)ListenPort=10051LogFile=/var/log/zabbix/zabbix_proxy.logLogFileSize=0PidFile=/var/run/zabbix/zabbix_proxy.pidDBHost=localhostDBName=zabbix_proxyDBUser=zabusrDBPassword=zbxproxyDBSocket=/var/lib/mysql/mysql.sockDBPort=3306ProxyLocalBuffer=1 //Proxy向Server成功发送数据后保存的时候,单位小时ProxyOfflineBuffer=24 //Proxy与Server断开连接后数据保存时间,单位小时ConfigFrequency=600 //Proxy向Server请求配置文件的时间周期,单位秒DataSenderFrequency=5 //Proxy向Server发送收集数据的时间周期,单位秒ExternalScripts=/usr/lib/zabbix/externalscripts[root@Proxy ~]#[root@Proxy zabbix]# /etc/init.d/zabbix-proxy startStarting Zabbix proxy: [ OK ][root@Proxy zabbix]#[root@Proxy zabbix]# netstat -anp|grep 10051tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 1481/zabbix_proxy tcp 0 0 :::10051 :::* LISTEN 1481/zabbix_proxy [root@Proxy zabbix]#
[root@Node ~]# grep -v ^# /etc/zabbix/zabbix_agentd.conf |grep -v ^$PidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix/zabbix_agentd.logLogFileSize=0Server=192.168.31.150 //Proxy地址ListenPort=10050ServerActive=192.168.31.150 //Proxy地址Hostname=192.168.31.160Include=/etc/zabbix/zabbix_agentd.d/UserParameter=Memory.total,/etc/zabbix/scripts/Memory_status.sh Memory_totalUserParameter=Memory.used,/etc/zabbix/scripts/Memory_status.sh Memory_usedUserParameter=Memory.free,/etc/zabbix/scripts/Memory_status.sh Memory_freeUserParameter=Swap.total,/etc/zabbix/scripts/Memory_status.sh Swap_totalUserParameter=Swap.used,/etc/zabbix/scripts/Memory_status.sh Swap_usedUserParameter=Swap.free,/etc/zabbix/scripts/Memory_status.sh Swap_freeUserParameter=Total.total,/etc/zabbix/scripts/Memory_status.sh Total_totalUserParameter=Total.used,/etc/zabbix/scripts/Memory_status.sh Total_usedUserParameter=Total.free,/etc/zabbix/scripts/Memory_status.sh Total_free[root@Node ~]#
[root@Proxy ~]# tail -2 /etc/hosts192.168.31.150Proxy.example.com192.168.31.160Node.example.com[root@Proxy ~]#[root@Node ~]# tail -2 /etc/hosts192.168.31.160Node.example.com192.168.31.150Proxy.example.com[root@Node ~]#[root@CentOS ~]# tail -6 /etc/hosts172.24.17.130 Zabbix.example.com172.24.17.130 mail.com mail mail.com.com localhost localhost.localdomain172.24.17.131 131.example.com172.24.17.132 132.example.com192.168.31.160Node.example.com192.168.31.150Proxy.example.com[root@CentOS ~]#
//添加Porxy
Proxy发现主机