Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/common/plugins/memory_utilization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [Enabling and Disabling](#enabling-and-disabling)
- [Configuration Examples](#configuration-examples)
- [Supported Memory Monitors](#supported-memory-monitors)
- [Monit Status Monitor](#monit-status-monitor)
- [Monit Validate Monitor](#monit-validate-monitor)
- [Free Memory Monitor](#free-memory-monitor)
- [Docker Stats Monitor](#docker-stats-monitor)
- [Top Monitor](#top-monitor)
Expand Down Expand Up @@ -225,12 +225,12 @@ Memory utilization checking is enabled by default for all tests. To disable it:

## Supported Memory Monitors and Configuration Examples

### Monit Status Monitor
### Monit Validate Monitor

Monitors system memory usage via Monit.

- **Command**: `sudo monit status`
- **Parser Function**: `parse_monit_status_output`
- **Command**: `sudo monit validate`
- **Parser Function**: `parse_monit_validate_output`
- **Monitored Parameters**:
- `memory_usage`: System memory utilization percentage
- **Threshold Type**: Use `percentage_points` for percentage-based thresholds
Expand All @@ -239,7 +239,7 @@ Example configuration:
```json
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -252,7 +252,7 @@ Example configuration:
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
}
```

Expand Down Expand Up @@ -414,7 +414,7 @@ Example:
"Arista-7050QX": [
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -427,7 +427,7 @@ Example:
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions tests/common/plugins/memory_utilization/memory_utilization.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,12 @@ def parse_free_output(output, memory_params):
return memory_values


def parse_monit_status_output(output, memory_params):
"""Parse the 'monit status' command output to extract memory usage information."""
def parse_monit_validate_output(output, memory_params):
"""Parse the 'monit validate' command output to extract memory usage information."""
memory_values = {}

if not output:
logger.warning("Empty output for monit status command, returning empty values")
logger.warning("Empty output for monit validate command, returning empty values")
return memory_values

memory_pattern = r"memory usage\s+([\d\.]+ \w+)\s+\[(\d+\.\d+)%\]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"COMMON": [
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -15,7 +15,7 @@
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -54,7 +54,7 @@
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
},
{
"name": "docker",
Expand Down Expand Up @@ -203,7 +203,7 @@
"Arista-7050QX": [
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -216,13 +216,13 @@
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
}
],
"Mellanox-SN4600C": [
{
"name": "monit",
"cmd": "sudo monit status",
"cmd": "sudo monit validate",
"memory_params": {
"memory_usage": {
"memory_increase_threshold": {
Expand All @@ -235,7 +235,7 @@
}
}
},
"memory_check": "parse_monit_status_output"
"memory_check": "parse_monit_validate_output"
},
{
"name": "docker",
Expand Down
Loading