Zabbix_agent 安装脚本

2015-10-20 0 By admin

一、Zabbix_agent 安装脚本

echo "please input the hostname"
read host_name
echo "please input the proxy or server ip address"
read proxy_ip
cd /usr/local/src
wget http://source/zabbix-2.2.5.tar.gz
tar xzf zabbix-2.2.5.tar.gz
cd zabbix-2.2.5
yum install make gcc gcc-c++ autoconf ncurses-devel fping net-snmp* curl libcurl curl-devel -y
./configure --prefix=/usr/local/zabbix --with-net-snmp --with-libcurl --enable-agent
make install
groupadd zabbix
useradd zabbix -g zabbix
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
sed -i "s/Server=$proxy_ip/" /usr/local/zabbix/etc/zabbix_agentd.conf
sed -i "s/Hostname=Zabbix server/Hostname=$host_name/" /usr/local/zabbix/etc/zabbix_agentd.conf
sed -i "s/ServerActive=$proxy_ip/" /usr/local/zabbix/etc/zabbix_agentd.conf
sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#" /etc/init.d/zabbix_agentd
/etc/init.d/zabbix_agentd start
chkconfig zabbix_agentd on




-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
-A OUTPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT


  1. Server:被动模式,运行哪台服务器连接Agent;Incoming connections will be accepted only from the hosts listed here.
  2. ServerActive:主动模式,向哪台服务器传输数据。If this parameter is not specified, active checks are disabled.


  1. zabbix_agent.conf是用超级服务(xinetd)的方式来启动的。
  2. zabbix_agentd.conf是以独立进程的方式来启动的。