diff --git a/unattended_installer/install_functions/manager.sh b/unattended_installer/install_functions/manager.sh index 42715804f5..a33e564de2 100644 --- a/unattended_installer/install_functions/manager.sh +++ b/unattended_installer/install_functions/manager.sh @@ -46,14 +46,12 @@ 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")" wm_error=$(curl -k -s -X GET "https://127.0.0.1:55000/agents/outdated?pretty=true" -H "Authorization: Bearer ${TOKEN}") - wm_status=$(/var/ossec/bin/wazuh-control status) - error_message='"error": 0' - common_logger -d "${wm_status}" - if [[ ${wm_error,,} = *${error_message,,}* ]]; then + if [[ ${wm_error,,} = '"error": 0' ]]; then common_logger "Wazuh API connection successful" else common_logger -e "Wazuh API connection Error. $wm_error" + eval "/var/ossec/bin/wazuh-control status ${debug}" installCommon_rollBack exit 1 fi