-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce High Volume of Inventory Events Generated by Agent #590
Reduce High Volume of Inventory Events Generated by Agent #590
Conversation
dd56b5c
to
64c5d17
Compare
Tests:logs from mockserver with default configuration: LogsFromAgent Details
root@pm-ubuntu24-server:/home/pm-vagrant/workspace/wazuh-agent# ./build/wazuh-agent
[2025-02-10 20:40:26.913] [wazuh-agent] [info] [INFO] [process_options_unix.cpp:24] [StartAgent] Starting wazuh-agent
[2025-02-10 20:40:27.209] [wazuh-agent] [info] [INFO] [communicator.cpp:113] [SendAuthenticationRequest] Successfully authenticated with the manager.
[2025-02-10 20:40:27.209] [wazuh-agent] [info] [INFO] [inventory.cpp:19] [Start] Inventory module started.
[2025-02-10 20:40:27.209] [wazuh-agent] [info] [INFO] [logcollector.cpp:28] [Start] Logcollector module is disabled.
[2025-02-10 20:40:27.210] [wazuh-agent] [info] [INFO] [inventoryImp.cpp:991] [SyncLoop] Module started.
[2025-02-10 20:40:27.210] [wazuh-agent] [info] [INFO] [inventoryImp.cpp:974] [Scan] Starting evaluation.
[2025-02-10 20:40:29.902] [wazuh-agent] [info] [INFO] [inventoryImp.cpp:986] [Scan] Evaluation finished.
^C[2025-02-10 20:40:42.563] [wazuh-agent] [info] [INFO] [inventory.cpp:78] [Stop] Inventory module stopping...
[2025-02-10 20:40:42.563] [wazuh-agent] [info] [INFO] [logcollector.cpp:100] [Stop] Logcollector module stopped.
[2025-02-10 20:40:42.563] [wazuh-agent] [info] [INFO] [inventoryImp.cpp:974] [Scan] Starting evaluation.
[2025-02-10 20:40:42.563] [wazuh-agent] [info] [INFO] [inventoryImp.cpp:986] [Scan] Evaluation finished.
[2025-02-10 20:40:42.563] [wazuh-agent] [info] [INFO] [inventory.cpp:39] [Start] Inventory module stopped. while checking for processes or ports not in listening state this was the result:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
To complete the pr I would like to generate a package and install it, seeing that the configuration is correct. |
64c5d17
to
5d0b8ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Additional tests with packages confirmed:
root@pm-ubuntu24-server:/etc/wazuh-agent# cat wazuh-agent.yml
agent:
thread_count: 4
server_url: https://localhost:27000
retry_interval: 30s
verification_mode: none
events:
batch_interval: 10s
batch_size: 1MB
inventory:
enabled: true
interval: 1h
scan_on_start: true
hardware: true
system: true
networks: true
packages: true
ports: true
ports_all: false
processes: false
hotfixes: true
logcollector:
enabled: true
localfiles:
- /var/log/auth.log
reload_interval: 1m
read_interval: 500ms
|
Description
Closes #407
The Wazuh agent performs regular system inventory synchronization. By default, it is configured to inventory all supported data, including:
Both active processes and ports in use tend to change frequently, resulting in a significant volume of stateful synchronization messages (
create/delete
events). While this behavior is expected given the current configuration, it can lead to an overload of events and potentially impact system performance.Proposal
To reduce the volume of inventory synchronization messages, we propose disabling the following inventory options:
These options can be adjusted in the agent configuration as follows:
This adjustment is expected to significantly reduce the number of inventory-related events without affecting other critical functionalities.
Configuration Changes
Documentation Updates
Tests Introduced
Review Checklist