sufehmi icon

I/O load logging in CSV / Excel format

sufehmi | PRO | 03/08/17 07:44:58 PM UTC | 0 ⭐ | 1796 👁️ | Never ⏰ | []
Bash |

470 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
 
# log-iowait.sh
 
# a script to log the I/O load, 
# and store the output as CSV format, which can be opened directly in Excel
 
# Great for troubleshooting I/O related problems
 
# set this to run every minute in cron
 
logfile=/tmp/log-iowait.csv
 
# show timestamp + I/O wait statistic 
# -d 1 3 = delay 1 second, run 3 times (first run are usually spiked)
echo "\"`date +%H%M`\",\"`iostat -d 1 3 -c | tail -n 6 | head -n 1 | cut -c 35-39`\"" >> $logfile

Comments