wazuh-dashboard-plugins
wazuh-dashboard-plugins copied to clipboard
Create service to restart wazuh
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
- 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
- Click on the restart button and wait until it's done.
- Navigate to another route that uses some request for the API, and check that no error is thrown.
Restart failure
- 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
- Click on the restart button and wait until it's done.
- Once the first polling cycle is done, disconnect the manager from the app (in Docker, stop the container).
- 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:
Successfully restarted:
Restart error:
Cluster synchronization:
Cluster synchronization error:
We need to review this PR to check it includes only the work related to this issue. @yenienserrano
Branch renamed: 4277-centralized-restart-service-4.3-1.2-wzd New pull request required