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

Default Syscollector scan interval not set #15428

Merged

Conversation

MiguelazoDS
Copy link
Member

@MiguelazoDS MiguelazoDS commented Nov 17, 2022

Related issue
#15413

Description

This PR sets the scan time interval for Syscollector that was missing.

Configuration options

Section commented
2022-11-17_18-27

Logs/Alerts example

Getting Syscollector configuration from API.
2022-11-17_18-26
Syscollector scan is not triggered one after another in a few seconds.
image

  • Compilation without warnings in every supported platform
    • Linux
  • Source installation
  • Source upgrade
  • Review logs syntax and correct language

pereyra-m
pereyra-m previously approved these changes Nov 18, 2022
Copy link
Member

@pereyra-m pereyra-m left a comment

Choose a reason for hiding this comment

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

LGTM!

@Dwordcito Dwordcito changed the base branch from 4.4 to master November 18, 2022 17:10
@Dwordcito Dwordcito dismissed pereyra-m’s stale review November 18, 2022 17:10

The base branch was changed.

@Dwordcito Dwordcito force-pushed the dev-15413-default-syscollector-scan-interval-not-set branch from 85e9275 to e5fb1f9 Compare November 18, 2022 17:13
Damian-Mangold
Damian-Mangold previously approved these changes Nov 18, 2022
Copy link
Member

@Damian-Mangold Damian-Mangold 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 previously approved these changes Nov 22, 2022
@mauromalara
Copy link
Contributor

mauromalara commented Nov 28, 2022

⚠️ Note

The test function called test_syscollector_default_values(), which was developed in wazuh/wazuh-qa#3584, was marked as XFAIL because of this issue. So, that test function must be unmarked after this issue is fixed.

jnasselle
jnasselle previously approved these changes Dec 2, 2022
@@ -46,14 +46,15 @@ static void parse_synchronization_section(wm_sys_t * syscollector, XML_NODE node
}

// Parse XML configuration
int wm_sys_read(const OS_XML *xml, XML_NODE node, wmodule *module) {
int wm_syscollector_read(const OS_XML *xml, XML_NODE node, wmodule *module) {
Copy link
Member

Choose a reason for hiding this comment

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

Naming +1!

Comment on lines -99 to +106
syscollector->interval *= 86400;
syscollector->interval *= W_DAY_SECONDS;
break;
case 'h':
syscollector->interval *= 3600;
syscollector->interval *= W_HOUR_SECONDS;
break;
case 'm':
syscollector->interval *= 60;
syscollector->interval *= W_MINUTE_SECONDS;
Copy link
Member

Choose a reason for hiding this comment

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

Functionality +1

Copy link
Member

Choose a reason for hiding this comment

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

?

src/wazuh_modules/wm_syscollector.h Outdated Show resolved Hide resolved
@MiguelazoDS MiguelazoDS dismissed stale reviews from jnasselle and pereyra-m via 28cd479 December 21, 2022 18:10
Co-authored-by: Juan Nicolas Asselle <jnasselle@gmail.com>
@Dwordcito Dwordcito merged commit 7494fd7 into master Dec 29, 2022
@Dwordcito Dwordcito deleted the dev-15413-default-syscollector-scan-interval-not-set branch December 29, 2022 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The default value of the interval field is not set when applying an empty configuration
7 participants