syncing new ansible playbook locations
This commit is contained in:
30
playbooks/infrastructure/debug_info.yml
Normal file
30
playbooks/infrastructure/debug_info.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: gather debug info
|
||||
hosts: "{{ HOSTS | default('web') }}"
|
||||
become: true
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Gather recent vmstat info
|
||||
command: /bin/vmstat 1 5
|
||||
register: vmstat
|
||||
|
||||
- name: Gather top CPU hogs
|
||||
command: ps -eo user,pid,size,pcpu,cmd --sort=-pcpu
|
||||
register: pscpu
|
||||
|
||||
- name: Gather top memory hogs
|
||||
command: ps -eo user,pid,size,pcpu,cmd --sort=-size
|
||||
register: pssize
|
||||
|
||||
- name: Swap + wait states
|
||||
debug:
|
||||
var: vmstat.stdout_lines
|
||||
|
||||
- name: Top 3 CPU hogs
|
||||
debug:
|
||||
var: pscpu.stdout_lines[:4]
|
||||
|
||||
- name: Top 3 memory hogs
|
||||
debug:
|
||||
var: pssize.stdout_lines[:4]
|
||||
Reference in New Issue
Block a user