check_es_system: Adding new plugin
This commit is contained in:
parent
b91fc10fa0
commit
a2422ebd49
10 changed files with 1215 additions and 0 deletions
27
check_es_system/check_es_system-1.12.0/test/test_readonly.sh
Executable file
27
check_es_system/check_es_system-1.12.0/test/test_readonly.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
echo "Test Elasticsearch status"
|
||||
./check_es_system.sh -H 127.0.0.1 -P 9200 -t readonly
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo -e "\e[1m\e[32m✔ Test 2.1 OK: Readonly check worked and no read_only indexes were found\e[0m"
|
||||
exitcode=0
|
||||
else
|
||||
echo -e "\e[1m\e[31m✘ Test 2.1 ERROR: Readonly check has not worked or read_only indexes were found\e[0m"
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
# Create an index with read_only setting
|
||||
curl -X PUT "127.0.0.1:9200/my-index-002" -H 'Content-Type: application/json' -d'{ "settings": { "index": { "blocks.read_only": true } } }'
|
||||
sleep 5
|
||||
|
||||
./check_es_system.sh -H 127.0.0.1 -P 9200 -t readonly
|
||||
if [[ $? -eq 2 ]]; then
|
||||
echo -e "\e[1m\e[32m✔ Test 2.1 OK: Readonly check worked and detected a read only index\e[0m"
|
||||
exitcode=0
|
||||
else
|
||||
echo -e "\e[1m\e[31m✘ Test 2.1 ERROR: Readonly check has not worked as expected\e[0m"
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
|
||||
exit $exitcode
|
27
check_es_system/check_es_system-1.12.0/test/test_status.sh
Executable file
27
check_es_system/check_es_system-1.12.0/test/test_status.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
echo "Test Elasticsearch status"
|
||||
./check_es_system.sh -H 127.0.0.1 -P 9200 -t status
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo -e "\e[1m\e[32m✔ Test 1.1 OK: Status check worked and shows green\e[0m"
|
||||
exitcode=0
|
||||
else
|
||||
echo -e "\e[1m\e[31m✘ Test 1.1 ERROR: Status check has not worked\e[0m"
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
# Create index with a replica, this should result in unassigned shards and yellow status
|
||||
curl -X PUT "127.0.0.1:9200/my-index-001" -H 'Content-Type: application/json' -d'{ "settings": { "index": { "number_of_shards": 2, "number_of_replicas": 1 } } }'
|
||||
sleep 5
|
||||
|
||||
./check_es_system.sh -H 127.0.0.1 -P 9200 -t status
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\e[1m\e[32m✔ Test 1.2 OK: Status check worked and shows yellow\e[0m"
|
||||
exitcode=0
|
||||
else
|
||||
echo -e "\e[1m\e[31m✘ Test 1.2 ERROR: Status check has not worked as expected\e[0m"
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
|
||||
exit $exitcode
|
Loading…
Add table
Add a link
Reference in a new issue