centos6.x 编译安装zabbix_proxy 2.2.5
步骤:分为两个部分
第一部分:服务上执行命令
mkdir /soft
cd /soft/
wget https://master.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.15/zabbix-2.2.15.tar.gz
tar zxf zabbix-2.2.15.tar.gz
groupadd zabbix
useradd -g zabbix zabbix
yum -y remove mysql*
find / -name mysql
cd /soft/
wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
ls -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
yum repolist all | grep mysql
yum install mysql-community-server -y
chkconfig --list | grep mysqld
chkconfig mysqld on
mysql -h127.0.0.1 -uroot -pxxxxxxx
create database zabbix_proxy character set utf8 collate utf8_bin;
grant all privileges on zabbix_proxy.* to zabbixuser@localhost identified by "zabbix";
flush privileges;
find / -name schema.sql
gzip /soft/zabbix-2.2.15/database/mysql/schema.sql
zcat /soft/zabbix-2.2.15/database/mysql/schema.sql.gz |mysql -u zabbixuser zabbix_proxy -p
mkdir /usr/local/zabbix_proxy
yum install gcc mysql-devel net-snmp-devel curl-devel -y
cd /soft/zabbix-2.2.15
./configure --prefix=/usr/local/zabbix_proxy --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurl
make
make install
vim /usr/local/zabbix_proxy/etc/zabbix_proxy.conf
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
tail /tmp/zabbix_proxy.log
zabbix_proxy.conf配置
********************
ProxyMode=1
Server=xxx.com
Hostname=xxx-proxy
LogFile=/data/logs/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
DBHost=localhost
DBName=zabbix_proxy2
DBUser=zabbix
DBPassword=xxxxxxx
DBSocket=/tmp/mysql.sock
ConfigFrequency=60
StartPollers=10
StartPollersUnreachable=20
StartTrappers=60
StartPingers=15
StartHTTPPollers=5
CacheSize=150M
HistoryCacheSize=80M
Timeout=15
UnreachablePeriod=60
UnreachableDelay=30
ExternalScripts=/usr/lib/zabbix/externalscripts
********************
第二部分:在zabbix web 端配置代理,填写name 和mode 还有IP 端口。
保存。
踩过的坑:
proxy 和server 版本要一致
我初次搭建proxy 版本是3.x
而server 版本是2.x
所以在查看proxy日志的时候,发现有报错,查询之后发现是版本不一致导致。