环境: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 -predhat mysql> 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.130 Hostname=Proxy.example.com //这里必须和Zannix WEB gui上保持一直(DM) ListenPort=10051 LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_proxy.pid DBHost=localhost DBName=zabbix_proxy DBUser=zabusr DBPassword=zbxproxy DBSocket=/var/lib/mysql/mysql.sock DBPort=3306 ProxyLocalBuffer=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 start Starting Zabbix proxy: [ OK ] [root@Proxy zabbix]# [root@Proxy zabbix]# netstat -anp|grep 10051 tcp 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.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=192.168.31.150 //Proxy地址 ListenPort=10050 ServerActive=192.168.31.150 //Proxy地址 Hostname=192.168.31.160 Include=/etc/zabbix/zabbix_agentd.d/ UserParameter=Memory.total,/etc/zabbix/scripts/Memory_status.sh Memory_total UserParameter=Memory.used,/etc/zabbix/scripts/Memory_status.sh Memory_used UserParameter=Memory.free,/etc/zabbix/scripts/Memory_status.sh Memory_free UserParameter=Swap.total,/etc/zabbix/scripts/Memory_status.sh Swap_total UserParameter=Swap.used,/etc/zabbix/scripts/Memory_status.sh Swap_used UserParameter=Swap.free,/etc/zabbix/scripts/Memory_status.sh Swap_free UserParameter=Total.total,/etc/zabbix/scripts/Memory_status.sh Total_total UserParameter=Total.used,/etc/zabbix/scripts/Memory_status.sh Total_used UserParameter=Total.free,/etc/zabbix/scripts/Memory_status.sh Total_free [root@Node ~]#
[root@Proxy ~]# tail -2 /etc/hosts 192.168.31.150Proxy.example.com 192.168.31.160Node.example.com [root@Proxy ~]# [root@Node ~]# tail -2 /etc/hosts 192.168.31.160Node.example.com 192.168.31.150Proxy.example.com [root@Node ~]# [root@CentOS ~]# tail -6 /etc/hosts 172.24.17.130 Zabbix.example.com 172.24.17.130 mail.com mail mail.com.com localhost localhost.localdomain 172.24.17.131 131.example.com 172.24.17.132 132.example.com 192.168.31.160Node.example.com 192.168.31.150Proxy.example.com [root@CentOS ~]#
//添加Porxy
Proxy发现主机
本文出自 “鹏城-酱油瓶” 博客,谢绝转载!
原文地址:http://yfshare.blog.51cto.com/8611708/1769100