标签:
检测logstash的conf脚本
check_logstash_serve.sh
#!bin/bash # check logstash running ? if not,start it # example: sh check_logstash_serve.sh flumelck /opt/modules/logstash/exec_sh/lck/lck_start.sh #传入脚本名 serveName=$1 num=`ps -ef | grep $serveName |grep jruby | wc -l` echo $num if [ $num -eq 0 ] then echo "The $serveName is not running...we will start it..." #传入启动脚本路径 exec_start_sh=$2 if [ ! -f $exec_start_sh ]; then echo "The second arg is not file ,please check it..." exit 3 fi sh $exec_start_sh #sendmail to someone sh /auto_cron/cron-running/tool/logstash-auto-check/sendmail_logstash_start.sh $serveName else echo "The $serveName is running!!!!!!!!!!" fi
在写一个一个脚本可以批量监控多个logstash服务:
autorun-dp-logstash_check_all.sh
#!bin/bash #owner:dp #cronTime:*/10 * * * * #author: #mail: #commitDate: #inputData: #outputData: #private:none #cronDir:/auto_cron/cron-running/tool/logstash-auto-check #cronfile:autorun-dp-logstash_check_all.sh #cronlogDir: #describe: #sql:none #other:none #new conf serve for logstash , add check_sh here ,easy check it!
path='/auto_cron/cron-running/tool/logstash-auto-check/' cd /opt/logstash/bin/ #flumelck sh ${path}check_logstash_serve.sh conf/conf_kafka_flumelck.conf /opt/logstash/bin/run_logstash_flumelck.sh #apputrack sh ${path}check_logstash_serve.sh conf/conf_kafka_apputrack.conf /opt/logstash/bin/run_logstash_apputrack.sh #mobile sh ${path}check_logstash_serve.sh conf/conf_kafka_mobile.conf /opt/logstash/bin/run_logstash_mobile.sh
标签:
原文地址:http://blog.csdn.net/shan1369678/article/details/51332013