centos 5早已失去支持,无法简单用yum安装zabbix agent了,记录下手工安装的方法
cd /usr/local
# 编译libpcre,为了不引起系统问题,只编译不安装,用的时候动态引入
wget https://versaweb.dl.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.bz2
tar xf pcre-8.45.tar.bz2 && cd pcre-8.45
./configure
make
mv .libs lib
cd ../
# 编译安装zabbix agent
wget https://cdn.zabbix.com/zabbix/sources/stable/5.0/zabbix-5.0.24.tar.gz
tar xf zabbix-5.0.24.tar.gz && cd zabbix-5.0.24
./configure --enable-agent --with-libpcre-include=/usr/local/pcre-8.45 --with-libpcre-lib=/usr/local/pcre-8.45/lib
make install
cd /usr/local/sbin/
groupadd zabbix
useradd -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix
# 修改默认启动程序,将动态库路径包括进去
mv zabbix_agentd zabbix_agentd_c
echo 'export LD_LIBRARY_PATH=/usr/local/pcre-8.45/lib
/usr/local/sbin/zabbix_agentd_c -c /usr/local/etc/zabbix_agentd.conf' >zabbix_agentd
chmod +x zabbix_agentd
vi /usr/local/etc/zabbix_agentd.conf
# 修改 Server ServerActive Hostname
# 手工启动zabbix agent
./zabbix_agentd