The network.healthchecks.cpu role allows monitoring of CPU usage on network devices. This helps detect excessive CPU consumption, ensuring device stability and performance. The role provides a comprehensive health check view that shows the status of CPU utilization and overall system health.
- Monitor CPU utilization with configurable thresholds
- Detect high CPU load conditions
- Generate alerts for excessive usage
- Provide detailed health check status (PASS/FAIL)
- Show CPU utilization statistics (1-minute, 5-minute averages)
| Variable Name | Default Value | Required | Type | Description |
|---|---|---|---|---|
cpu_threshold |
80 | no | int | CPU usage percentage threshold for health check. |
- name: Run network.cpu validated content with health_checks operation
ansible.builtin.include_role:
name: network.healthchecks.cpu
vars:
cpu_utilization:
details: true
warning_threshold: 90
critical_threshold: 95
register: result
- name: Display CPU health check results
ansible.builtin.debug:
var: cpu_result.health_checks{
"health_checks": {
"cpu_utilization": {
"status": "PASS",
"1_min_avg": 0,
"5_min_avg": 0,
"threshold": 80
},
"result": "PASS"
}
}result: Overall health check resultPASS: CPU utilization is below the thresholdFAIL: CPU utilization is above the threshold
cpu_utilization: CPU metricsstatus: Individual CPU check status1_min_avg: 1-minute CPU utilization average5_min_avg: 5-minute CPU utilization averagethreshold: CPU utilization threshold (default: 80)
GNU General Public License v3.0 or later.
See LICENSE to see the full text.
- Ansible Network Content Team