Last active
September 14, 2017 03:11
-
-
Save portante/0b294318c68dc362481e2994b9030200 to your computer and use it in GitHub Desktop.
A simple script to check the state of Elasticsearch from within an ES pod in an OpenShift cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ES_URL='https://localhost:9200' | |
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
date | |
$curl_get $ES_URL/_cat/health?v | |
$curl_get $ES_URL/_cat/nodes?v | |
$curl_get $ES_URL/_cat/indices?v 2>&1 | grep -vE "^green" | |
$curl_get $ES_URL/_cat/indices?v 2>&1 | grep "searchguard" | |
$curl_get $ES_URL/_cat/count?v | |
sleep 5 | |
$curl_get $ES_URL/_cat/count?v | |
date |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following lists all the known indices and their state in the cluster: