Skip to content

Instantly share code, notes, and snippets.

@Ruborcalor
Created August 21, 2020 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ruborcalor/ea6421e3071c14921272a958166ab5fd to your computer and use it in GitHub Desktop.
Save Ruborcalor/ea6421e3071c14921272a958166ab5fd to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
while true
do
cat /proc/loadavg | ts | tee -a loadavg.csv
free -m | grep Mem | tr -s " " | cut -d " " -f2,3,4,5,6,7 | ts | tee -a memory.csv
iostat | awk '/avg-cpu/ {getline; $1=$1; print}' | ts | tee -a iostat.csv
top -b -n 1 | head | awk -F' ' 'FNR == 3 {print $2, $4, $6, $8, $10, $12, $14}' | ts | tee -a cpu_monitor.csv
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment