Hello,
It is not possible to delete modules in the agent configuration right now. We have some issues opened about this here:
https://github.com/wazuh/wazuh/issues/6882
https://github.com/wazuh/wazuh/issues/3737
But some options could help:
ossec.conf you want, I could do it for you.Hello,
Sorry for the late response. I have attached de wpk package, you will have to download it in your wazuh manager and unzip it. For installing it you have two options:
Run /var/ossec/bin/agent_upgrade -a <AGENT_ID> -F -f <PATH_TO_WPK_PACKAGE> -x upgrade.bat
(Recommended) Using the API:
First of all, you need to place the wpk package in /var/ossec. Now, you can start with the update:
Get the TOKEN:
TOKEN=$(curl -u <USER>:<PASSWORD> -k -X GET "https://localhost:55000/security/user/authenticate?raw=true")
Run the custom upgrade:
curl -k -X PUT "https://localhost:55000/agents/upgrade_custom?agents_list=<AGENT_ID>&file_path=/var/ossec/wazuh_agent_v4.0.4-4.0.4.custom_windows.wpk&pretty=true" -H "Authorization: Bearer $TOKEN"
You can check the update result with:
curl -k -X GET "https://localhost:55000/agents/upgrade_result?agents_list=<AGENT_ID>&pretty=true" -H Authorization: Bearer $TOKEN"
I also recommend you check the upgrade folder in /var/ossec, there you will be able to find the file upgrade.log and it should look like this:
2021-08-05 09:11:47Z - Current version: v4.0.4 2021-08-05 09:11:47Z - Generating backup.
2021-08-05 09:11:47Z - Trying to stop Wazuh service again. Remaining attempts: 5.
2021-08-05 09:11:49Z - Starting upgrade processs.
2021-08-05 09:11:49Z - Waiting for the installation end.
2021-08-05 09:11:51Z - Waiting for the installation end.
2021-08-05 09:11:53Z - Waiting for the installation end.
2021-08-05 09:11:55Z - Waiting for the installation end.
2021-08-05 09:11:57Z - Waiting for the installation end.
2021-08-05 09:11:59Z - Restarting Wazuh service.
2021-08-05 09:11:59Z - Installation finished.
2021-08-05 09:11:59Z - Process ID: 1164
2021-08-05 09:11:59Z - Reading status file: status='connected'
2021-08-05 09:11:59Z - Upgrade finished successfully.
2021-08-05 09:11:59Z - New version: v4.0.4
Hello,
Sorry, I sent you the command for Wazuh version 4.1.5, the right commands for version 4.0.4 would be:
curl -k -X PUT "https://localhost:55000/agents/<AGENT_ID>/upgrade_custom?file_path=/var/ossec/wazuh_agent_v4.0.4-4.0.4.custom_windows.wpk&pretty=true" -H "Authorization: Bearer $TOKEN"
curl -k -X GET "https://localhost:55000/agents/<AGENT_ID>/upgrade_result?pretty=true" -H "Authorization: Bearer $TOKEN"
Also, if you have run TOKEN=$(curl -u wazuh:wazuh -k -X GET "https://localhost:55000/security/user/authenticate?raw=true") to get the TOKEN, you don’t need to write it in the above commands, just with $TOKEN would be enough.
--
You received this message because you are subscribed to a topic in the Google Groups "Wazuh mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wazuh/cUi3G-p4NSM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/cc84c1e8-b234-4baf-aab4-8947bd069127n%40googlegroups.com.
Hello,
I have tried to reproduce your error but it wasn’t possible. Those errors usually are produced by a problem with the connection between the API and Wazuh. Did you try to send the request a few more times? Could you take a look to /var/ossec/logs/api.log and check if there is any error produced?
If you check the C:\Program Files (x86)\ossec-agent\upgrade\upgrade.log did the agent update? Did the configuration change as you desired?