amuck-landowner

OpenVZ IO accounting spreadsheet

jhadley

New Member
Verified Provider
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.

 


Code:
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
 
Top
amuck-landowner