太懒
分类: Oracle
2014-10-31 15:33:56
[root@node3 ~]# more /etc/zabbix/zabbix_agentd.conf | grep ^[^#$] PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=my2950.momo.org ServerActive=my2950.momo.org Include=/etc/zabbix/zabbix_agentd.d/ UnsafeUserParameters=1 [root@node3 ~]##!/bin/bash # install zabbix-agent # a.fanliao@gmail.com # Jun 20 10:37:40 CST 2013 . /etc/profile a=0 while [ $a -lt 1 ]; do rpm -Uhv && (( a++ )) sleep 2 #if [ $? != 0 ];then # echo "install zabbix repo failed!" #else # echo "install zabbix repo ok" # a=a+1 #fi done b=0 while [ $b -lt 1 ]; do yum --enablerepo=zabbix install zabbix-agent -y && (( b++ )) sleep 2 done #ok chkconfig zabbix-agent on || ( echo "chkconfig failed" ) #wget ftp://my2950.momo.org/pub/kik/zabbix/zabbix_agentd.conf.linux if [ -f /etc/zabbix/zabbix_agentd.conf ];then mv /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.orig && ( echo "mv orig conf file" ) wget ftp://my2950.momo.org/pub/kik/zabbix/zabbix_agentd.conf.linux -O /etc/zabbix/zabbix_agentd.conf.linux || ( echo "wget failed" ) ln -s /etc/zabbix/zabbix_agentd.conf.linux /etc/zabbix/zabbix_agentd.conf || ( echo "ln failed" ) else wget ftp://my2950.momo.org/pub/kik/zabbix/zabbix_agentd.conf.linux -O /etc/zabbix/zabbix_agentd.conf.linux || ( echo "wget failed" ) ln -s /etc/zabbix/zabbix_agentd.conf.linux /etc/zabbix/zabbix_agentd.conf || ( echo "ln failed" ) fi service zabbix-agent start || ( echo "services failed" ) echo "more /etc/zabbix/zabbix_agentd.conf" more /etc/zabbix/zabbix_agentd.conf | grep ^[^#$]