Skip to content

Commit

Permalink
Debugging API check
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Aug 29, 2024
1 parent 70f2db6 commit 987ef36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion install_functions/manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ function manager_startCluster() {
function manager_checkService() {
common_logger "Checking Wazuh API connection"
eval "TOKEN=$(curl -k -s -X POST -u "wazuh-wui:wazuh-wui" https://127.0.0.1:55000/security/user/authenticate/run_as?raw=true -d '{"user_name":"wzread"}' -H "content-type:application/json")"
set -x
wm_error=$(curl -k -s -X GET "https://127.0.0.1:55000/agents/outdated?pretty=true" -H "Authorization: Bearer ${TOKEN}")

if [[ ${wm_error,,} =~ '"error": 0' ]]; then
common_logger "Wazuh API connection successful"
else
Expand All @@ -55,6 +56,7 @@ function manager_checkService() {
installCommon_rollBack
exit 1
fi
set +x
}

function manager_configure(){
Expand Down

0 comments on commit 987ef36

Please sign in to comment.