#!/bin/bash iotop -btoqqq --iter=2| egrep -o "[0-9.]+\s%\sqemu-system-x86_64(.*)\s-name [a-z][0-9]{1,4}" |awk '{colone[$6]+=$1 tot[$6]++ ; } END { for (i in colone) { print "vm_io{vm=\""i "\"} " colone[i]/tot[i]; }}'