Skip to content
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

Friendly log connection attempts #255

Closed
Tracked by #241
vikman90 opened this issue Oct 28, 2024 · 2 comments · Fixed by #273
Closed
Tracked by #241

Friendly log connection attempts #255

vikman90 opened this issue Oct 28, 2024 · 2 comments · Fixed by #273
Assignees
Labels
level/task Task issue module/agent mvp Minimum Viable Product refinement type/enhancement Enhancement issue

Comments

@vikman90
Copy link
Member

vikman90 commented Oct 28, 2024

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.
@vikman90 vikman90 added the type/enhancement Enhancement issue label Oct 28, 2024
@vikman90 vikman90 mentioned this issue Oct 28, 2024
53 tasks
@wazuhci wazuhci moved this to Backlog in XDR+SIEM/Release 5.0.0 Oct 28, 2024
@vikman90 vikman90 added mvp Minimum Viable Product refinement and removed mvp labels Oct 29, 2024
@vikman90 vikman90 self-assigned this Oct 31, 2024
@wazuhci wazuhci moved this from Backlog to In progress in XDR+SIEM/Release 5.0.0 Oct 31, 2024
@vikman90
Copy link
Member Author

Update

October 31

  • Disabled trace and debug logs by default.

@aritosteles
Copy link
Contributor

aritosteles commented Nov 1, 2024

Update

October 31

Rebased work branch.
Getting clarification on the issue's requirements and looking into logger library.

November 1

Trying different logger configurations. Further testing needed.

November 4

Changed logger output.
Fixed failing logger test.
PR is up for review

November 5

Rebased branch to master. PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue module/agent mvp Minimum Viable Product refinement type/enhancement Enhancement issue
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants