Restart manager from script.

26 views
Skip to first unread message

Nepolean

unread,
Apr 20, 2023, 8:54:55 AM4/20/23
to Wazuh mailing list
Dear Team,

I am writing a python script which runs on active response. It's purpose is to create a cdb list. I want my script to restart the manager programmatically. How can I do that?

Thanks
Nepolean

Nahuel Figueroa

unread,
Apr 20, 2023, 9:08:18 AM4/20/23
to Wazuh mailing list
Hi Nepolean! yes i didn't understand, do you want to restart wazuh-manager in your python script?

Nepolean

unread,
Apr 20, 2023, 9:14:27 AM4/20/23
to Wazuh mailing list
Yes Nahuel. My script currently create a list. I want to extent that script to restart the wazuh-manager so that it will compile my list to cdb list.

Nahuel Figueroa

unread,
Apr 20, 2023, 9:16:51 AM4/20/23
to Wazuh mailing list
If this is the case you could try using the subprocess module that python offers. And then run this line in your script:
subprocess.run([systemctl restart wazuh-manager])
Reply all
Reply to author
Forward
0 new messages