1.解压
tar -xf zabbix-3.0.3.tar.gz
cd zabbix-3.0.3
2.配置
./configure --prefix=/usr/local/zabbix --enable-agent
3.编译
make install
4.配置安装zabbix后的初始化脚本
#!/bin/bash #创建用户 useradd zabbix #创建log目录 mkdir /var/log/zabbix chown zabbix.zabbix /var/log/zabbix #配置启动脚本 cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ chmod 755 /etc/init.d/zabbix_agentd sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_agentd #创建软链接 ln -s /usr/local/zabbix/etc /etc/zabbix ln -s /usr/local/zabbix/bin/zabbix_get /usr/bin/ ln -s /usr/local/zabbix/bin/zabbix_sender /usr/bin/ ln -s /usr/local/zabbix/sbin/zabbix_agent /usr/sbin/ ln -s /usr/local/zabbix/sbin/zabbix_agentd /usr/sbin/
#开机启动
chkconfig zabbix_agentd on
5、打包
[root@gametest ~]# fpm -s dir -t rpm -n zabbix_agent -v 3.0.3 --post-install /root/install_zabbix.sh -f /usr/local/zabbix/ no value for epoch is set, defaulting to nil {:level=>:warn} no value for epoch is set, defaulting to nil {:level=>:warn} Created package {:path=>"zabbix_agent-3.0.3-1.x86_64.rpm"}