Guest User

Untitled

a guest
Feb 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. # Make a tmp file
  2. cpu_data_file=$(mktemp /tmp/cpu_data.XXX);
  3. # Fill the file with stuff
  4. sadf -- -u | awk '/%idle/ {print $3" "$6}' > $cpu_data_file
  5. # Make a pretty graph
  6. echo "set terminal dump;
  7. set title 'CPU usage';
  8. set xdata time;
  9. set timefmt '%s';
  10. set xlabel 'Time';
  11. plot '$cpu_data_file' using 1:2 with lines title 'CPU usage';" | gnuplot
  12. # Remove tmp file
  13. rm -f $cpu_data_file
Add Comment
Please, Sign In to add comment