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

The offline_checkPrerequisites function must be deleted #96

Closed
davidcr01 opened this issue Oct 4, 2024 · 1 comment · Fixed by #99
Closed

The offline_checkPrerequisites function must be deleted #96

davidcr01 opened this issue Oct 4, 2024 · 1 comment · Fixed by #99
Assignees
Labels
level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment

Comments

@davidcr01
Copy link
Contributor

Description

While documenting the Wazuh installation assistant functions, I noticed that the offline_checkPrerequisites is the same as the offline_checkDependencies function:

function offline_checkPrerequisites(){
dependencies=("$@")
common_logger "Checking prerequisites for Offline installation."
for dep in "${dependencies[@]}"; do
if [ "${sys_type}" == "yum" ]; then
eval "yum list installed 2>/dev/null | grep -q -E ^"${dep}"\\."
elif [ "${sys_type}" == "apt-get" ]; then
eval "apt list --installed 2>/dev/null | grep -q -E ^"${dep}"\/"
fi
if [ "${PIPESTATUS[0]}" != 0 ]; then
common_logger -e "${dep} is necessary for the offline installation."
exit 1
fi
done
common_logger -d "Offline prerequisites are installed."
}

The offline_checkPrerequisites function is duplicated and it not being used.

Note

This function is in the code of the 4.10.0 version.

@davidcr01 davidcr01 added level/task Task issue type/change Change performed in a resource or Wazuh Cloud environment labels Oct 4, 2024
@davidcr01 davidcr01 changed the title The offline_checkPrerequisites must be deleted The offline_checkPrerequisites function must be deleted Oct 4, 2024
@c-bordon c-bordon self-assigned this Oct 4, 2024
@wazuhci wazuhci moved this to In progress in Release 4.10.0 Oct 4, 2024
@wazuhci wazuhci moved this from In progress to On hold in Release 4.10.0 Oct 7, 2024
@wazuhci wazuhci moved this from On hold to In progress in Release 4.10.0 Oct 8, 2024
@Enaraque
Copy link
Member

Enaraque commented Oct 8, 2024

Update report

We removed the offline_checkDependencies function to use only the offline_checkPrerequisites instead. With this, we have added a new parameter when we call to offline_checkPrerequisites to check the dependencies to differentiate the wazuh installation assistant dependencies from the wazuh offline installation prerequisites.

Testing

For now, we have been testing this functionality in RPM instances. It remains to be tested in APT ones.

  • Dashboard offline installation example:
[root@ip-172-31-46-248 wazuh-installation-assistant]# bash wazuh-install.sh --offline-installation --wazuh-dashboard dashboard -o
08/10/2024 17:05:00 INFO: Starting Wazuh installation assistant. Wazuh version: 4.9.0
08/10/2024 17:05:00 INFO: Verbose logging redirected to /var/log/wazuh-install.log
In offline_checkPrerequisites:
Dependencies: curl tar gnupg openssl lsof
08/10/2024 17:05:01 INFO: Checking dependencies for Wazuh installation assistant.
08/10/2024 17:05:05 INFO: --- Removing existing Wazuh installation ---
08/10/2024 17:05:05 INFO: Removing Wazuh dashboard.
08/10/2024 17:05:24 WARNING: The Wazuh dashboard package could not be removed.
08/10/2024 17:05:24 INFO: Installation cleaned.
08/10/2024 17:05:24 INFO: Verifying that your system meets the recommended minimum hardware requirements.
08/10/2024 17:05:24 INFO: Wazuh web interface port will be 443.
In offline_checkPrerequisites:
Dependencies: libcap
08/10/2024 17:05:25 INFO: Checking prerequisites for Offline installation.
08/10/2024 17:05:25 INFO: Checking wazuh-offline.tar.gz file.
08/10/2024 17:05:26 INFO: --- Wazuh dashboard ----
08/10/2024 17:05:26 INFO: Starting Wazuh dashboard installation.
08/10/2024 17:07:50 INFO: Wazuh dashboard installation finished.
08/10/2024 17:07:51 INFO: Wazuh dashboard post-install configuration finished.
08/10/2024 17:07:51 INFO: Starting service wazuh-dashboard.
08/10/2024 17:07:52 INFO: wazuh-dashboard service started.
08/10/2024 17:08:15 INFO: Initializing Wazuh dashboard web application.
08/10/2024 17:08:15 INFO: Wazuh dashboard web application initialized.
08/10/2024 17:08:15 INFO: --- Summary ---
08/10/2024 17:08:15 INFO: You can access the web interface https://<wazuh-dashboard-ip>:443
    User: admin
    Password: 4tLp+PiYp0sm7I?EZyKrggjlimeTm+n5
08/10/2024 17:08:15 INFO: Installation finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment