zabbix客户端安装脚本-zabbix-agentd-install.sh

#!/bin/bash
#System:CentOS 6.7
#Install soft version:zabbix-2.4.2.tar.gz
service iptables stop
setenforce 0
groupadd zabbix
useradd -g zabbix -m zabbix
cd /usr/local/src
tar zxvf zabbix-2.4.2.tar.gz
cd zabbix-2.4.2
./configure --prefix=/usr/local/zabbix --enable-agent
make && make install
cd /usr/local/zabbix/etc/
sed -i 's/Server=127.0.0.1/Server=192.168.2.144/g' zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive=192.168.2.144/g' zabbix_agentd.conf
localip=`ifconfig eth0 | grep 'inet addr' |sed 's/^.*addr://g'|sed 's/Bcast.*$//g'`
echo $localip
sed -i "s/Hostname=Zabbix server/Hostname=$localip/g"  zabbix_agentd.conf
/usr/local/zabbix/sbin/zabbix_agentd start
echo /usr/local/zabbix/sbin/zabbix_agentd start >>/etc/rc.d/rc.local
rm -rf /usr/local/src/zabbix-2.4.2
/bin/netstat -antup | grep zabbix
分割线
感谢打赏
江西数库信息技术有限公司
YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS