check_es_system: Update to 1.12.1
This commit is contained in:
parent
47225a26b6
commit
65f532cb2f
9 changed files with 36 additions and 12 deletions
18
check_es_system/check_es_system-1.12.1/test/test_disk.sh
Executable file
18
check_es_system/check_es_system-1.12.1/test/test_disk.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
echo "Test Elasticsearch status"
|
||||
./check_es_system.sh -H 127.0.0.1 -P 9200 -t disk
|
||||
output=$(./check_es_system.sh -H 127.0.0.1 -P 9200 -t disk)
|
||||
|
||||
if [[ $? -eq 0 ]]; then
|
||||
echo -e "\e[1m\e[32m✔ Test 3.1 OK: Disk check worked and shows green\e[0m"
|
||||
exitcode=0
|
||||
else
|
||||
echo -e "\e[1m\e[31m✘ Test 3.1 ERROR: Disk check has not worked\e[0m"
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
if ! [[ "${output}" =~ "ES SYSTEM OK - Disk usage is at 0%" ]]; then
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
exit $exitcode
|
27
check_es_system/check_es_system-1.12.1/test/test_readonly.sh
Executable file
27
check_es_system/check_es_system-1.12.1/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.1/test/test_status.sh
Executable file
27
check_es_system/check_es_system-1.12.1/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