wazuh / qa-system-framework

GNU General Public License v2.0
1 stars 3 forks source link

Implementation of agent remove method in WazuhHandler #50

Open pro-akim opened 1 year ago

pro-akim commented 1 year ago
Related Issue
#46

Description

This PR includes a method for removing agents from the manager.

Evidences

Running:

from wazuh_qa_framework.system.wazuh_handler import WazuhEnvironmentHandler wh = WazuhEnvironmentHandler('inventory.yml') agent = ['agent1', 'agent2'] print('1. Remove by cmd in parallel') wh.remove_agents_from_manager(agent, manager=None, method='cmd', parallel=True , logs=False, restart=False) print('2. Remove by cmd sequentially') wh.remove_agents_from_manager(agent, manager=None, method='cmd', parallel=False , logs=False, restart=False) print('3. Remove by API') wh.remove_agents_from_manager(agent, manager=None, method='api', parallel=False , logs=True, restart=True) print('4. Removing agents by API + delete logs') wh.remove_agents_from_manager(agent, manager=None, method='api', parallel=False , logs=False, restart=False) print('5. Removing agents by API + restart') wh.remove_agents_from_manager(agent, manager=None, method='api', parallel=False , logs=False, restart=True)

Results:

1. Agents deleted 2. Agents deleted 4. Agents deleted 5. Agents deleted + logs deleted 6. Agents deleted + agent restarted