docs/ref/modules/agent-management/agent-groups.md
Agent groups allow administrators to organize Wazuh agents into logical collections for targeted configuration and policy management. Each group has its own shared directory on the Wazuh manager where centralized configuration files and shared resources are stored.
All agents belong to the default group by default. Agents can be assigned to one or more groups, enabling flexible policy management across the deployment.
agent.conf and any shared files.Each group has a dedicated directory under the manager's shared configuration path:
/var/wazuh-manager/etc/shared/
├── default/
│ └── agent.conf
├── web-servers/
│ └── agent.conf
├── database-servers/
│ └── agent.conf
└── dmz/
└── agent.conf
PUT /groups?group_id=<GROUP_NAME>
Example using curl:
TOKEN=$(curl -u <USER>:<PASSWORD> -k -X POST "https://<MANAGER_IP>:55000/security/user/authenticate" | jq -r '.data.token')
curl -k -X PUT "https://<MANAGER_IP>:55000/groups?group_id=web-servers" \
-H "Authorization: Bearer $TOKEN"
GET /groups
PUT /agents/<AGENT_ID>/group/<GROUP_NAME>
DELETE /agents/<AGENT_ID>/group/<GROUP_NAME>
DELETE /groups?groups_list=<GROUP_NAME>
/var/wazuh-manager/bin/agent_groups -l
/var/wazuh-manager/bin/agent_groups -a -g <GROUP_NAME>
/var/wazuh-manager/bin/agent_groups -a -i <AGENT_ID> -g <GROUP_NAME>
/var/wazuh-manager/bin/agent_groups -r -i <AGENT_ID> -g <GROUP_NAME>
Agents can belong to multiple groups simultaneously. When an agent is in multiple groups, the configurations from all groups are merged.
When an agent belongs to multiple groups, the configurations are merged in alphabetical order by group name. If a conflict occurs (the same setting defined in multiple groups), the value from the group that appears first alphabetically takes precedence.
An agent assigned to groups database-servers and web-servers:
default group configuration is applied first.database-servers group configuration is merged.web-servers group configuration is merged.In addition to agent.conf, the group shared directory can contain other files that are distributed to agents in the group:
These files are placed in the group's shared directory and are automatically distributed to agents in the group.