Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISM rollover] Bug when trying to use the -i option in the ISM script #2583

Closed
2 tasks done
c-bordon opened this issue Nov 8, 2023 · 0 comments · Fixed by #2585
Closed
2 tasks done

[ISM rollover] Bug when trying to use the -i option in the ISM script #2583

c-bordon opened this issue Nov 8, 2023 · 0 comments · Fixed by #2585
Assignees
Labels
level/task Subtask issue type/bug Bug issue

Comments

@c-bordon
Copy link
Member

c-bordon commented Nov 8, 2023

Related: https://github.com/wazuh/internal-devel-requests/issues/425

In tests carried out with the installation wizard for a distributed installation, it was detected that the -i argument does not work correctly:

root@ubuntu22:~# /usr/share/wazuh-indexer/bin/indexer-ism-init.sh -i 192.168.56.254 -p U0wf+SIuE75JtZ?9ngsVtEyvSIeI+w.o
TEMPLATES AND POLICIES - Uploading wazuh-alerts template
TEMPLATES AND POLICIES - Uploading wazuh-archives template
++ curl -s -k -u 'admin:U0wf+SIuE75JtZ?9ngsVtEyvSIeI+w.o' -X GET https://localhost:9200/_plugins/_ism/policies/rollover_policy -o /dev/null -w '%{http_code}'
+ policy_exists=000
+ [[ 000 == \4\0\4 ]]
+ [[ 000 == \2\0\0 ]]
+ echo 'TEMPLATES AND POLICIES - Error uploading rollover_policy policy'
TEMPLATES AND POLICIES - Error uploading rollover_policy policy
+ set +x
TEMPLATES AND POLICIES - Creating write indices
root@ubuntu22:~# /usr/share/wazuh-indexer/bin/indexer-ism-init.sh -p U0wf+SIuE75JtZ?9ngsVtEyvSIeI+w.o -i 192.168.56.254
TEMPLATES AND POLICIES - Uploading wazuh-alerts template
TEMPLATES AND POLICIES - Uploading wazuh-archives template
++ curl -s -k -u 'admin:U0wf+SIuE75JtZ?9ngsVtEyvSIeI+w.o' -X GET https://localhost:9200/_plugins/_ism/policies/rollover_policy -o /dev/null -w '%{http_code}'
+ policy_exists=000
+ [[ 000 == \4\0\4 ]]
+ [[ 000 == \2\0\0 ]]
+ echo 'TEMPLATES AND POLICIES - Error uploading rollover_policy policy'
TEMPLATES AND POLICIES - Error uploading rollover_policy policy
+ set +x
TEMPLATES AND POLICIES - Creating write indices

This is because the INDEXER_URL variable is not replaced when using this argument, and is left with the value of INDEXER_HOSTNAME="localhost"

INDEXER_URL="https://${INDEXER_HOSTNAME}:9200"

Tasks:

  • Make a new definition of this variable within the if argument -i or leave only one variable in the case of the URL
  • Verify that all script options work correctly
@c-bordon c-bordon added level/task Subtask issue type/bug Bug issue labels Nov 8, 2023
@AlexRuiz7 AlexRuiz7 self-assigned this Nov 8, 2023
@AlexRuiz7 AlexRuiz7 mentioned this issue Nov 8, 2023
30 tasks
@AlexRuiz7 AlexRuiz7 linked a pull request Nov 8, 2023 that will close this issue
30 tasks
@c-bordon c-bordon closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Subtask issue type/bug Bug issue
Projects
No open projects
Archived in project
2 participants