forked from wazuh/wazuh-docker
Add Wazuh indexer check with Attempts
This commit is contained in:
+26
-16
@@ -147,14 +147,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Wazuh indexer start
|
- name: Check Wazuh indexer start
|
||||||
run: |
|
run: |
|
||||||
sleep 240
|
for i in {1..10}; do
|
||||||
status_green="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s | grep -E "green|yellow" | wc -l`"
|
echo "Checking Wazuh indexer health (Attempt $i/10)"
|
||||||
if [[ $status_green -eq 1 ]]; then
|
RESPONSE=$(curl -XGET "https://0.0.0.0:9200/_cluster/health?pretty" -u admin:admin -k -s)
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s
|
|
||||||
else
|
if echo "$RESPONSE" | grep -qE "green|yellow"; then
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s
|
echo "Cluster Online"
|
||||||
exit 1
|
echo "$RESPONSE"
|
||||||
fi
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Waiting for cluster to be online"
|
||||||
|
[ $i -lt 10 ] && sleep 60
|
||||||
|
done
|
||||||
status_index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | wc -l`"
|
status_index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | wc -l`"
|
||||||
status_index_green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | grep -E "green|yellow" | wc -l`"
|
status_index_green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | grep -E "green|yellow" | wc -l`"
|
||||||
if [[ $status_index_green -eq $status_index ]]; then
|
if [[ $status_index_green -eq $status_index ]]; then
|
||||||
@@ -344,14 +349,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Wazuh indexer start
|
- name: Check Wazuh indexer start
|
||||||
run: |
|
run: |
|
||||||
sleep 360
|
for i in {1..10}; do
|
||||||
status_green="`curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s | grep green | wc -l`"
|
echo "Checking Wazuh indexer health (Attempt $i/10)"
|
||||||
if [[ $status_green -eq 1 ]]; then
|
RESPONSE=$(curl -XGET "https://0.0.0.0:9200/_cluster/health?pretty" -u admin:admin -k -s)
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s
|
|
||||||
else
|
if echo "$RESPONSE" | grep -qE "green|yellow"; then
|
||||||
curl -XGET "https://0.0.0.0:9200/_cluster/health" -u admin:admin -k -s
|
echo "Cluster Online"
|
||||||
exit 1
|
echo "$RESPONSE"
|
||||||
fi
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Waiting for cluster to be online"
|
||||||
|
[ $i -lt 10 ] && sleep 60
|
||||||
|
done
|
||||||
status_index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | wc -l`"
|
status_index="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | wc -l`"
|
||||||
status_index_green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | grep -E "green" | wc -l`"
|
status_index_green="`curl -XGET "https://0.0.0.0:9200/_cat/indices" -u admin:admin -k -s | grep -E "green" | wc -l`"
|
||||||
if [[ $status_index_green -eq $status_index ]]; then
|
if [[ $status_index_green -eq $status_index ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user