forked from wazuh/wazuh-docker
Change Wazuh agent check
This commit is contained in:
@@ -284,10 +284,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Wazuh agent enrollment
|
- name: Check Wazuh agent enrollment
|
||||||
run: |
|
run: |
|
||||||
sleep 20
|
for i in {1..5}; do
|
||||||
curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${{env.TOKEN}}"
|
TOKEN=$(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X GET "https://127.0.0.1:55000/security/user/authenticate?raw=true")
|
||||||
env:
|
agents="`curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" | jq -r .data.affected_items | grep active | wc -l`"
|
||||||
TOKEN: $(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X GET "https://127.0.0.1:55000/security/user/authenticate?raw=true")
|
if [[ $agents -gt 1 ]]; then
|
||||||
|
echo "Wazuh agents: ${agents}"
|
||||||
|
echo "OK"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}"
|
||||||
|
echo "Wazuh agents: ${agents}. Retrying in 10s"
|
||||||
|
[ $i -lt 5 ] && sleep 10
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Check errors in ossec.log for Wazuh manager
|
- name: Check errors in ossec.log for Wazuh manager
|
||||||
run: ./.github/single-node-log-check.sh
|
run: ./.github/single-node-log-check.sh
|
||||||
@@ -520,10 +529,19 @@ jobs:
|
|||||||
|
|
||||||
- name: Check Wazuh agent enrollment
|
- name: Check Wazuh agent enrollment
|
||||||
run: |
|
run: |
|
||||||
sleep 20
|
for i in {1..5}; do
|
||||||
curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${{env.TOKEN}}"
|
TOKEN=$(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X GET "https://127.0.0.1:55000/security/user/authenticate?raw=true")
|
||||||
env:
|
agents="`curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" | jq -r .data.affected_items | grep active | wc -l`"
|
||||||
TOKEN: $(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X GET "https://127.0.0.1:55000/security/user/authenticate?raw=true")
|
if [[ $agents -gt 1 ]]; then
|
||||||
|
echo "Wazuh agents: ${agents}"
|
||||||
|
echo "OK"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}"
|
||||||
|
echo "Wazuh agents: ${agents}. Retrying in 10s"
|
||||||
|
[ $i -lt 5 ] && sleep 10
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Check errors in ossec.log for Wazuh manager
|
- name: Check errors in ossec.log for Wazuh manager
|
||||||
run: ./.github/multi-node-log-check.sh
|
run: ./.github/multi-node-log-check.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user