Skip to content

Latest commit

 

History

History
70 lines (57 loc) · 2.13 KB

File metadata and controls

70 lines (57 loc) · 2.13 KB

network.healthchecks.cpu

Overview

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.

Features

  • 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)

Variables

Variable Name Default Value Required Type Description
cpu_threshold 80 no int CPU usage percentage threshold for health check.

Usage

Example: Monitoring CPU Usage

- 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

Output: CPU Health Check Status

{
    "health_checks": {
        "cpu_utilization": {
            "status": "PASS",
            "1_min_avg": 0,
            "5_min_avg": 0,
            "threshold": 80
        },
        "result": "PASS"
    }
}

Health Check Status

  • result: Overall health check result
    • PASS: CPU utilization is below the threshold
    • FAIL: CPU utilization is above the threshold
  • cpu_utilization: CPU metrics
    • status: Individual CPU check status
    • 1_min_avg: 1-minute CPU utilization average
    • 5_min_avg: 5-minute CPU utilization average
    • threshold: CPU utilization threshold (default: 80)

License

GNU General Public License v3.0 or later.

See LICENSE to see the full text.

Author Information

  • Ansible Network Content Team