Listing agents using the CLI

The binary agent_control, used with -l option, allows for the retrieval of a list of the available agents:

# /var/ossec/bin/agent_control -l
Wazuh agent_control. List of available agents:
   ID: 000, Name: vpc-ossec-manager (server), IP:, Active/Local
   ID: 1040, Name: ip-10-0-0-76, IP:, Active
   ID: 003, Name: vpc-agent-debian, IP:, Active
   ID: 005, Name: vpc-agent-ubuntu-public, IP:, Active
   ID: 006, Name: vpc-agent-windows, IP:, Active
   ID: 1024, Name: ip-10-0-0-252, IP:, Never connected
   ID: 1028, Name: vpc-debian-it, IP: any, Never connected
   ID: 1030, Name: diamorphine-POC, IP:, Active
   ID: 015, Name: vpc-agent-centos, IP:, Active
   ID: 1031, Name: WIN-UENN0U6R5SF, IP:, Never connected
   ID: 1032, Name: vpc-agent-ubuntu, IP:, Active
   ID: 1033, Name: vpc-agent-debian8, IP:, Active
   ID: 1034, Name: vpc-agent-redhat, IP:, Active
   ID: 1035, Name: vpc-agent-centos7, IP:, Never connected
   ID: 1041, Name: vpc-agent-centos-public, IP:, Active

List of agentless devices:
   ID: 010, Name: agentless-ubuntu, IP:, Active

Also, users can retrieve the connected agents by using the manage_agents with -l option:

# /var/ossec/bin/manage_agents -l
Available agents:
   ID: 001, Name: agent-ubuntu2, IP: any
   ID: 002, Name: agent-ubuntu1, IP: any