Logstash service detection and pull up

Source: Internet
Author: User
Tags logstash

conf script for detecting Logstash

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# Incoming script name servename=$1num= ' Ps-ef | grep $serveName |grep JRuby | Wc-l ' echo $numif [$num-eq 0]thenecho "The $serveName is not running...we would start it ..." #传入启动脚本路径exec_start_sh =$2if [!-f $exec _start_sh]; Thenecho "The second arg is not a file, please check it ..." Exit 3fish $exec _start_sh#sendmail to Someonesh/auto_cron/cron-r Unning/tool/logstash-auto-check/sendmail_logstash_start.sh $serveNameelseecho "The $serveName is running!!!!!!!!!!" Fi


Write a script that can monitor multiple Logstash services in bulk:

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/#flumelcksh ${path}check_logstash_ serve.sh Conf/conf_kafka_flumelck.conf/opt/logstash/bin/run_logstash_flumelck.sh#apputracksh ${path}check_ logstash_serve.sh Conf/conf_kafka_apputrack.conf/opt/logstash/bin/run_logstash_apputrack.sh#mobilesh ${path} Check_logstash_serve.sh conf/conf_kafka_mobile.conf/opt/logstash/bin/run_logstash_mobile.sh

So finally through Crontab can monitor the Logstash service, hang off the service can be pulled up again.



Logstash service detection and pull up

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.