while true; do
ps -eo pid,ppid,cmd,%mem,%cpu --sort -pcpu,+pmemps -eo pid,ppid,%mem,%cpu --sort -pcpu,+pmem | awk '{if ($3!=0){total1 += $3;print "MEM:"$3"%";}} END { print "SUM MEM:"total1"%" }'
ps -eo pid,ppid,%mem,%cpu --sort -pcpu,+pmem | awk '{if ($4!=0){total2 += $4;print "CPU:"$4"%";}} END { print "SUM CPU:"total2"%" }'
sleep 3;
done&
No comments:
Post a Comment