Skip to content

Disconnected time in ossec-agentd.state (max_time_reconnect_try)#5142

Merged
vikman90 merged 1 commit intomasterfrom
5138-agentd-state-reconnect-time
Jun 1, 2020
Merged

Disconnected time in ossec-agentd.state (max_time_reconnect_try)#5142
vikman90 merged 1 commit intomasterfrom
5138-agentd-state-reconnect-time

Conversation

@pereyra-m
Copy link
Copy Markdown
Contributor

Related issue
#5138

Description

After replacing the notify_time variable with max_time_reconnect_try, it is possible to note that the file ossec-agentd.state is displaying the correct disconnected time.

Closes #5138

ossec-agentd.state file

This is an example of the file ossec-agentd.state when the bug appeared. It can be noted that both connected and disconnected time have the same value

# Agent status:
# - pending:      waiting for get connected.
# - connected:    connection established with manager in the last 5 seconds.
# - disconnected: connection lost or no ACK received in the last 5 seconds. 

After replacing the variable, the ossec-agentd.state file show the correct values for both times

# Agent status:
# - pending:      waiting to get connected.
# - connected:    connection established with manager in the last 10 seconds.
# - disconnected: connection lost or no ACK received in the last 60 seconds.

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X
  • Source installation
  • Package installation
  • Source upgrade
  • Package upgrade
  • Review logs syntax and correct language
  • QA templates contemplate the added capabilities
  • Memory tests for Linux
    • Scan-build report
    • Coverity
    • Valgrind (memcheck and descriptor leaks check)
    • Dr. Memory
    • AddressSanitizer
  • Memory tests for Windows
    • Scan-build report
    • Coverity
    • Dr. Memory
  • Memory tests for macOS
    • Scan-build report
    • Leaks
    • AddressSanitizer
  • Retrocompatibility with older Wazuh versions
  • Working on cluster environments
  • Configuration on demand reports new parameters
  • The data flow works as expected (agent-manager-api-app)
  • Added unit tests (for new features)
  • Stress test for affected components

@pereyra-m pereyra-m added type/bug Something isn't working module/agent Issues related to the agent daemon labels May 30, 2020
@pereyra-m pereyra-m requested a review from vikman90 May 30, 2020 00:46
@pereyra-m pereyra-m self-assigned this May 30, 2020
@pereyra-m pereyra-m changed the title Replaced notify_time for max_time_reconnect_try in disconnected agent… Disconnected time in ossec-agentd.state (max_time_reconnect_try) May 30, 2020
@wazuhci
Copy link
Copy Markdown
Contributor

wazuhci commented May 30, 2020

Analysis_dynamic_valgrind logcollector analysis:

Commit: 5103f0a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:31.41% of 1859

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.13.0-B2361.log

@wazuhci
Copy link
Copy Markdown
Contributor

wazuhci commented May 30, 2020

Analysis_dynamic_valgrind syscheckd analysis:

Commit: 5103f0a
Parameters: track-origins="yes" leak-check="full" keep-stacktraces="alloc-and-free" track-fds="yes" num-callers="20" show-leak-kinds="definite,indirect"
Agent config: ossec.conf
Agent logs: ossec.log
Coverage:

Lines executed:26.90% of 3190

Coverage report detail: coverage-report-summary
Valgrind result: Analysis_dynamic_valgrind-v3.13.0-B2362.log

Copy link
Copy Markdown
Member

@vikman90 vikman90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pereyra-m pereyra-m added this to the Sprint 112 - Core milestone Jun 1, 2020
@vikman90 vikman90 merged commit 776cc20 into master Jun 1, 2020
@vikman90 vikman90 deleted the 5138-agentd-state-reconnect-time branch June 1, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/agent Issues related to the agent daemon type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wazuh agent not showing correct disconnected time in ossec-agentd.state

3 participants