wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Create service to restart wazuh

Open yenienserrano opened this issue 2 years ago • 1 comments

Description:

The way to restart the manager or cluster was centralized in a service since each view that had the option to restart did it differently.

In order to allow the cluster to synchronize ruleset changes, a delay was applied before restarting Wazuh. This delay has been removed as it's been replaced by a polling system, so it's no longer required. The app will ping the Wazuh API and wait until it's back up again. If this does not happen, the app will show an error message, as the API did not come back online.

Due to the changes of this development, code has been removed as it was no longer used.

PR above with more information (a revert was made):

  • #4365

Issue:

  • #4277

Test:

To test it you have to go to any page that has the restart option and try doing the restart, when it tells you that it has restarted try navigating between pages that make requests to the API.

Successful restart

  1. Navigate to one of the following sections:
  • Management > Configuration > Edit configuration
  • Management > Status
  • Management > Rules and edit file
  • Management > Decoders and edit file
  • Management > CDB lists and edit file
  1. Click on the restart button and wait until it's done.
  2. Navigate to another route that uses some request for the API, and check that no error is thrown.

Restart failure

  1. Navigate to one of the following sections:
  • Management > Configuration > Edit configuration
  • Management > Status
  • Management > Rules and edit file
  • Management > Decoders and edit file
  • Management > CDB lists and edit file
  1. Click on the restart button and wait until it's done.
  2. Once the first polling cycle is done, disconnect the manager from the app (in Docker, stop the container).
  3. Wait until the modal changes state, showing that the restart has failed. A button to redirect to the Healthcheck must also appear. Check this button works properly.

Screenshot:

Ongoing restart:

image

Successfully restarted:

image

Restart error:

image

Cluster synchronization:

image

Cluster synchronization error:

image

yenienserrano avatar Sep 01 '22 09:09 yenienserrano

We need to review this PR to check it includes only the work related to this issue. @yenienserrano

AlexRuiz7 avatar Sep 09 '22 10:09 AlexRuiz7

Branch renamed: 4277-centralized-restart-service-4.3-1.2-wzd New pull request required

AlexRuiz7 avatar Dec 14 '22 10:12 AlexRuiz7