Skip to content

Commit

Permalink
Modify Wazuh manager test
Browse files Browse the repository at this point in the history
  • Loading branch information
vcerenu committed Jul 29, 2024
1 parent 2870477 commit ec127a0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions unattended_installer/install_functions/manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec127a0

Please sign in to comment.