#!/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
2017-04-18
zabbix客户端安装脚本-zabbix-agentd-install.sh
评论
发表评论
姓 名: