Um script de shell para plotar os campos CPL (load average) de um arquivo de log no topo.
#!/bin/sh -u
# $0 [atop logfile to plot]
log=${1-'/var/log/atop.log'}
tmp=/tmp/atop$$
rm -f $tmp
trap "rm -f $tmp" 0 1 2
atop -PCPL -r "$log" >$tmp
gnuplot -persist <<EOF
set xdata time
set timefmt '%Y/%m/%d %H:%M:%S'
set format x "%Y\n%m/%d\n%H:%M"
set grid
set title "CPL"
plot \
"$tmp" using 4:8 t '' , \
"$tmp" using 4:8 smooth csplines t '', \
"$tmp" using 4:9 t '' , \
"$tmp" using 4:9 smooth csplines t '' , \
"$tmp" using 4:10 t '' , \
"$tmp" using 4:10 smooth csplines t '' ;
EOF