
转角复制[root@www20 shell]# cat zabbix_agentd_install.sh #!/bin/sh #Create by sfzhang 2014.02.27 yum -y install net-snmp yum -y install net-snmp-devel BASE_DIR="/data/software" TAR="zabbix-2.2.1.tar.gz" tar -zxvf $BASE_DIR/$TAR -C$BASE_DIR cd $BASE_DIR/zabbix-2.2.1 ./configure--prefix=/usr/local/zabbix --sysconfdir=/etc/zabbix --enable-agent make && make install groupadd zabbix useradd zabbix -g zabbix cpmisc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd chmod 700/etc/init.d/zabbix_agentd chown zabbix.zabbix/etc/init.d/zabbix_agentd sed -i "/BASEDIR=/s#/.*#/usr/local/zabbix#" /etc/init.d/zabbix_agentd sed -i"s#bin/zabbix_agentd#sbin/zabbix_agentd#" /etc/init.d/zabbix_agentd sed -i"s#Server=127.0.0.1#Server=192.168.161.129#"/etc/zabbix/zabbix_agentd.conf sed -i"s#ServerActive=127.0.0.1#\#ServerActive=127.0.0.1#"/etc/zabbix/zabbix_agentd.conf sed -i "/Hostname=/s#=.*#"=$HOSTNAME#""/etc/zabbix/zabbix_agentd.conf sed -i"s#\#/tmp/zabbix_agentd.pid#/data/logs/zabbix_agentd.pid#"/etc/zabbix/zabbix_agentd.conf sed -i"s#/tmp/zabbix_agentd.log#/data/logs/zabbix_agentd.log#"/etc/zabbix/zabbix_agentd.conf sed -i "s#\#Timeout=3#Timeout=30#" /etc/zabbix/zabbix_agentd.conf cat>>/etc/services<<EOF #Zabbix services zabbix-agent 10050/tcp#Zabbix Agent zabbix-agent 10050/udp#Zabbix Agent zabbix-trapper 10051/tcp#Zabbix Trapper zabbix-trapper 10051/udp#Zabbix Trapper EOF /etc/init.d/zabbix_agentdstart 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.