Linux/Unix

Follow the steps below to configure a Linux/Unix endpoint for enrollment via the Wazuh agent configuration method:

  1. Launch the terminal, obtain root access, edit the Wazuh agent configuration file /var/ossec/etc/ossec.conf, and make the following changes:

    1. Include the Wazuh manager IP address or FQDN (Fully Qualified Domain Name) in the <client><server><address> section:

      <client>
        <server>
          <address><WAZUH_MANAGER_IP></address>
          ...
        </server>
      </client>
      

      This will allow the Wazuh agent to connect to the Wazuh manager and automatically request a client key.

      Note

      If you have a multi-cluster Wazuh server installation, you can add multiple <client> sections that point to the worker nodes. Refer to pointing agents to the cluster (Failover mode) for more information.

    2. (Optional) Add enrollment parameters in the <client><enrollment> section.

      <client>
          ...
          <enrollment>
              <agent_name>EXAMPLE_NAME</agent_name>
              <groups>GROUP1,GROUP2,GROUP3</groups>
              ...
          </enrollment>
      </client>
      

      These agent enrollment parameters are optional, and they provide the Wazuh agent with specific information that can be used during enrollment. Some common enrollment parameters can be seen below:

      • <agent_name>EXAMPLE_NAME</agent_name>: This setting specifies the name the Wazuh agent should be enrolled as. When this is not specified, it defaults to the hostname of the endpoint.

      • <groups>GROUP1,GROUP2,GROUP3</groups>: This setting specifies the group(s) in which the Wazuh agent should be added. An agent group is a collection of Wazuh agents that would share the same configuration. This allows the Wazuh manager to push configuration settings to a set of Wazuh agents that belong to the same group. The Wazuh agent enrollment will fail if a non-existent group is specified. Therefore, creating the desired group on the Wazuh manager before using the group parameter is necessary. Additional information on agent groups can be found here.

      More optional enrollment parameters and their usage can be found here.

  2. Restart the Wazuh agent to make the changes effective:

    # systemctl restart wazuh-agent
    
  3. Click on the upper-left menu icon and navigate to Server management > Endpoints Summary on the Wazuh dashboard to check for the newly enrolled Wazuh agent and its connection status. If the enrollment was successful, you will have an interface similar to the image below.

    Check newly enrolled Wazuh agent - Linux