Add playbooks and templates for CPUHog

This commit is contained in:
2024-04-17 13:16:41 -04:00
parent 5707153521
commit e5ec521ec4
3 changed files with 54 additions and 5 deletions

View File

@@ -0,0 +1,18 @@
---
- name: Investigate High CPU
hosts: all
become: true
tasks:
- name: Gather information on top CPU consuming processes
ansible.builtin.command:
cmd: 'ps -eo pid,ppid,%mem,%cpu,cmd --sort=-%cpu'
register: processes_cpu
- name: Gather information on top Memory consuming processes
ansible.builtin.command:
cmd: 'ps -eo pid,ppid,%mem,%cpu,cmd --sort=-%mem'
register: processes_mem
- name: Dump CPU details
ansible.builtin.debug:
msg: "{{ lookup('template','../templates/cpuhog_ticket.j2') }}"