[LearnAdmin] Monitoring of kibana and logstash services and start them if process not found

6 views
Skip to first unread message

Naresh Surampudi

unread,
Sep 4, 2015, 4:58:27 AM9/4/15
to learnadmin+g...@googlegroups.com
Kibana and logstash might run out of memory and application might get closed or get terminated. In that case we will be running the below script to monitor services and start them if not running .
There are other parameters that need to be verified before going for this option like java heap size etc.


#!/bin/bash

LOGSTASH=logstash
KIBANA=kibana


var1=`ps -ef|grep -i $LOGSTASH|sed -e '/grep/d'`

if [ -z "$var1" ]; then

nohup /opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf &

echo "Process logstash not found" | mail -s "Process logstash not found creating a new one" dev...@learnadmin.com

else

echo "process logstash  found."

fi

var2=`ps -ef|grep -i $KIBANA|sed -e '/grep/d'`

if [ -z "$var2" ]; then

nohup /opt/kibana/bin/kibana status &


echo "Process kibana  not found" | mail -s "Process kibana not found creating a new one" dev...@learnadmin.com

else

echo "process kibana found."


fi


--
Posted By Naresh Surampudi to LearnAdmin at 9/04/2015 02:28:00 PM
Reply all
Reply to author
Forward
0 new messages