Commit a81d3796 authored by 白秀江's avatar 白秀江

Update init-monitor.sh

parent 18f20dd5
......@@ -5,9 +5,16 @@ echo ${today} start init-monitor... >> /var/log/lwby-init-monitor.log
rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum install -y zabbix-agent zabbix-get
a=$(grep Server=127.0.0.1 /etc/zabbix/zabbix_agentd.conf)
b=$(grep ServerActive=127.0.0.1 /etc/zabbix/zabbix_agentd.conf)
sed -i "s/Server=127.0.0.1/Server=zabbix.ibreader.com/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=zabbix.ibreader.com/g" /etc/zabbix/zabbix_agentd.conf
if [[ ! -n $a ]] || [[ ! -n $b]] ; then
service zabbix-agent restart
echo ${today} service zabbix-agent restart... >> /var/log/lwby-init-monitor.log
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment