wazuh / wazuh

Wazuh - The Open Source Security Platform. Unified XDR and SIEM protection for endpoints and cloud workloads.
https://wazuh.com/
Other
10.91k stars 1.66k forks source link

Benchmarking tests: Monitoring class for process data collection #24683

Closed Rebits closed 1 month ago

Rebits commented 3 months ago

Description

Develop a monitoring class to collect process data within the Wazuh environment. This class should track various aspects of process performance, such as CPU usage, memory consumption, etc. The data collected will be used to analyze and optimize the performance of the Wazuh agent.

Overview

We are considering using existing tools for this task, specifically the QA Monitor class. This issue involves checking the current status of the monitor class, fixing any pending bugs, and adding any new capabilities needed to fulfill the requirements.

Functional requirements

Tasks

Validation

jseg380 commented 3 months ago

In a meeting with @Rebits some questions about the issue were clarified. These inquiries were the following:

jseg380 commented 3 months ago

Refactored current script to make use of "advanced" type hinting (making use of the typing module). Started modularization of Monitor and different logging classes. Researched references made to the Monitor class, only found wazuh_metrics.py. Extensive research about PEP 8 – Style Guide for Python Code.

jseg380 commented 2 months ago

Continued modularization of Monitor and Logging classes and addded type hinting for those last ones.

jseg380 commented 2 months ago

Increased functionality of Monitor class to track disk usage instead of creating another module because it seems appropiate in this situation since it already monitors memory size, swap, file descriptors, read and write operations and bytes read and written. As discussed with @Rebits some of the logic of some methods has to be modified not to depend on hardcoded values, or at least specify the available values that can be used.

Rebits commented 2 months ago

Moved ETA to 21/09/2024 to allow final review

jseg380 commented 2 months ago

On hold due to #25203

jseg380 commented 2 months ago

On hold due to #25270

jseg380 commented 2 months ago

Update

Refactoring the existing script that makes use of the module for resource monitoring (the script that is called).

jseg380 commented 2 months ago

On hold due to 4.9.0 RC 2 Footprint

jseg380 commented 2 months ago

Update

Worked on the creation of unit tests for the partition usage module.

jseg380 commented 1 month ago

On hold due to jenkins 6919 Even though the aforementioned issue has lower priority it's planned for the next release so it has precedence over this one.

jseg380 commented 1 month ago

Update

Created branch: enhancement/24683-process-resource-monitoring Associated PR: https://github.com/wazuh/wazuh-qa/pull/5747

jseg380 commented 1 month ago

Addressed the changes requested.

rafabailon commented 1 month ago

LGTM

jseg380 commented 1 month ago

Working on the changes requested in the PR (https://github.com/wazuh/wazuh-qa/pull/5747#discussion_r1775635279)