Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Make a tmp file
- cpu_data_file=$(mktemp /tmp/cpu_data.XXX);
- # Fill the file with stuff
- sadf -- -u | awk '/%idle/ {print $3" "$6}' > $cpu_data_file
- # Make a pretty graph
- echo "set terminal dump;
- set title 'CPU usage';
- set xdata time;
- set timefmt '%s';
- set xlabel 'Time';
- plot '$cpu_data_file' using 1:2 with lines title 'CPU usage';" | gnuplot
- # Remove tmp file
- rm -f $cpu_data_file
Add Comment
Please, Sign In to add comment