Log logstash watchdog.

Log the activity of the logstash watchdog script so that we can get
numbers on how often this bug occurs and to help debug the script if it
doesn't do what we expect.

Change-Id: Ib12be4e5212c311744f51f0d191323651752731f
This commit is contained in:
Clark Boylan 2014-02-28 16:12:43 -08:00
parent e6d78af997
commit e6efff22f6

@ -4,14 +4,20 @@
# Logstash disconnects from the cluster and will not rejoin under
# its own power.
date >> /var/log/logstash/watchdog.log
ES_ADDRESS=$1
echo "$ES_ADDRESS" >> /var/log/logstash/watchdog.log
JSON_OUT=$(curl -sf "http://${ES_ADDRESS}:9200/_cluster/nodes/${HOSTNAME}")
CURL_RET=$?
echo "$JSON_OUT" >> /var/log/logstash/watchdog.log
echo "$CURL_RET" >> /var/log/logstash/watchdog.log
RESULT=$(echo $JSON_OUT | jq '.nodes == {}')
echo "$RESULT" >> /var/log/logstash/watchdog.log
if [ "$CURL_RET" == "0" ] && [ "$RESULT" == "true" ] ;
then
echo "restarting" >> /var/log/logstash/watchdog.log
stop --quiet logstash-indexer
start --quiet logstash-indexer
fi