Files
bab-backend-ansible/playbooks/investigate_high_cpu.yml

18 lines
567 B
YAML

---
- 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') }}"