標籤:zabbix-agent 指令碼安裝
[[email protected] shell]# cat zabbix.sh
#!/bin/bash
set -x
HOST=`hostname`
DIR=/root
service iptables stop
AZ ()
{
groupadd zabbix
useradd zabbix -g zabbix -s /sbin/nologin
tar -zxvf $DIR/zabbix-1.8.5.tar.gz
cd zabbix-1.8.5
./configure --prefix=/usr/local/zabbix --enable-agent
make
make install
mkdir /etc/zabbix
cp $DIR/zabbix_agentd.conf /etc/zabbix/
sed -i "s/Hostname=.*/Hostname=$HOST/g" /etc/zabbix/zabbix_agentd.conf
/usr/local/zabbix/sbin/zabbix_agentd
echo "/usr/local/zabbix/sbin/zabbix_agentd &" >> /etc/rc.local
}
rpm -qa | grep ^gcc &> /dev/null
if [ $? -eq 0 ];then
echo -ne "\033[31m \033[05m start........\033[0m"
AZ
else
echo -ne "\033[31m \033[05m you are not install gcc ,Now we install gcc\033[0m"
yum install gcc -y
AZ
fi
本文出自 “路由汗水交換成功” 部落格,請務必保留此出處http://ghnhl.blog.51cto.com/1630025/1553291
shell指令碼安裝zabbix-agent