The network.healthchecks.memory role allows monitoring of memory usage on network devices. This helps detect excessive memory consumption, ensuring device stability and performance. The role provides a comprehensive health check view that shows the status of memory utilization and overall system health.
- Monitor memory utilization with configurable thresholds
- Track available free memory
- Monitor memory buffers and cache
- Generate alerts for excessive memory usage
- Provide detailed health check status (PASS/unPASS)
- Show memory statistics (total, used, free, buffers, cache)
| Variable Name | Default Value | Required | Type | Description |
|---|---|---|---|---|
critical_threshold |
80 | no | int | Memory usage percentage threshold for health check. |
min_free_memory |
100 | no | int | Minimum free memory in MB required for health check. |
min_buffers |
50 | no | int | Minimum buffers in MB required for health check. |
min_cache |
50 | no | int | Minimum cache in MB required for health check. |
- name: Monitor memory utilization
ansible.builtin.include_role:
name: network.healthchecks.memory
vars:
ansible_network_os: cisco.ios.ios
critical_threshold: 80
min_free_memory: 100
min_buffers: 50
min_cache: 50
ignore_errors: false
register: memory_result
- name: Display memory health check results
ansible.builtin.debug:
var: memory_result.health_checks{
"health_checks": {
"memory_utilization": {
"status": "PASS",
"current_utilization": 45,
"threshold": 80
},
"memory_free": {
"status": "PASS",
"current_free": 150,
"min_free": 100,
"free_mb": 550,
},
"memory_buffers": {
"status": "PASS",
"current_buffers": 75,
"min_buffers": 50,
"buffers_mb": 75,
},
"memory_cache": {
"status": "PASS",
"current_cache": 60,
"min_cache": 50,
"cache_mb": 60
},
"result": "PASS"
}
}status: Indicates whether each memory metric is within acceptable limitsPASS: Memory metrics are within thresholdsFAIL: Memory metrics exceed thresholds
result: Overall health check statusPASS: All checks passed (or failed checks are ignored)FAIL: At least one non-ignored check failed
GNU General Public License v3.0 or later.
See LICENSE to see the full text.
- Ansible Network Content Team