rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
      官方源,可能比较慢

      #!/bin/bash
SERVERIP=1.1.1.1
localip=$(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk -F":" '{print $2}')
[ $UID -ne 0 ] && exit;echo "You not is root!!!"
iptables -F && /etc/init.d/iptables stop && chkconfig iptables off
sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

cat > /etc/yum.repos.d/zabbix.repo << EOF
[zabbix]
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/2.4/rhel/6/\$basearch
gpgcheck=0
EOF
yum install zabbix-agent -y
sed -i.bak "s/Hostname=Zabbix server/Hostname=$localip/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/Server=127.0.0.1/Server=$SERVERIP/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=$SERVERIP:10051/g" /etc/zabbix/zabbix_agentd.conf
sed -i "261a\UnsafeUserParameters=1" /etc/zabbix/zabbix_agentd.conf
sed -i "168a\HostMetadataItem=system.uname" /etc/zabbix/zabbix_agentd.conf
chkconfig zabbix-agent on
service zabbix-agent start


windows
zabbix_agentd.exe –c c:\zabbix\zabbix_agentd.conf -i
zabbix_agentd.exe –c c:\zabbix\zabbix_agentd.conf –s

results matching ""

    No results matching ""