Quantcast
Channel: LowEndTalk
Viewing all articles
Browse latest Browse all 59145

OpenVZ IO accounting spreadsheet

$
0
0

I wrote a little script which is so little and so useful I thought it should be shared :)

This is to gather the IO reads and writes by container ID and put them in an Excel-friendly format. Just copy and paste the script in and copy and paste the results into Excel.

for CT in $(vzlist -H -o veid) 
do
    reads=$(cat /proc/bc/${CT}/ioacct | sed 's/\t//g' | grep ^read | awk '{ print $2 }')
    writes=$(cat /proc/bc/${CT}/ioacct | sed 's/\t//g' | grep ^write | awk '{ print $2 }')
    echo -e "${CT}\t${reads}\t${writes}"
done

Viewing all articles
Browse latest Browse all 59145

Trending Articles