Add playbooks and templates for CPUHog
This commit is contained in:
18
playbooks/investigate_high_cpu.yml
Normal file
18
playbooks/investigate_high_cpu.yml
Normal 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') }}"
|
||||
Reference in New Issue
Block a user