Skip to content

Friendly log connection attempts #255

@vikman90

Description

@vikman90

Parent Issue: #241

When the agent cannot connect to the manager, it floods the log with messages of this type:

[2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [http_client.cpp:188] [PerformHttpRequest ] Error: connect: Connection refused [system:111 at /root/wazuh-agent/build/vcpkg_installed/x64-linux/include/boost/asio/detail/reactive_socket_service.hpp:587:33 in function 'boost::system: :error_code boost::asio::detail::reactive_socket_serviceboost::asio::ip::tcp::connect(implementation_type &, const endpoint_type &, boost::system::error_code &) [Protocol = boost::asio::ip::tcp]'].
[2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [http_client.cpp:211] [AuthenticateWithUuidAndKey] Error: 500 .
[2024-10-28 16:53:50.965] [wazuh-agent] [error] [ERROR] [communicator.cpp:63] [SendAuthenticationRequest] Failed to authenticate with the manager.

These logs should be more user-friendly and less numerous.
Let's take inspiration from the 4.x agent:

  • It sends a readable "Trying to connect" log.
  • It waits (with adjustable time) between each attempt.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions