Skip to content

Instantly share code, notes, and snippets.

@arax
Created May 20, 2018 10:44
Show Gist options
  • Save arax/8d256a0773100d7e0572f237b5e77144 to your computer and use it in GitHub Desktop.
Save arax/8d256a0773100d7e0572f237b5e77144 to your computer and use it in GitHub Desktop.
Script gathering various internal data for system diagnostics and performance tuning
#!/bin/bash
{ top -n 5 -b > /tmp/top.out; vmstat 1 50 > /tmp/vm.out; iostat -tkx -p ALL 1 10 > /tmp/io.out; mpstat -A 1 10 > /tmp/mp.out; ps auwwx > /tmp/ps1.out; ps axHo %cpu,stat,pid,tid,pgid,ppid,comm,wchan > /tmp/ps2.out; sar -A 1 50 > /tmp/sar.out; free > /tmp/free.out; }
tar -cjvf outputs_$(hostname)_$(date +"%d-%b-%Y_%H%M").tar.bz2 /tmp/*.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment