Dstat also cleverly gives you the most detailed information in columns and clearly indicates in what magnitude and unit the output is displayed. Less confusion, less mistakes, more efficient.
Dstat is unique in letting you aggregate block device throughput for a certain diskset or network bandwidth for a group of interfaces, ie. you can see the throughput for all the block devices that make up a single filesystem or storage system.
Dstat allows its data to be directly written to a CSV file to be imported and used by OpenOffice, Gnumeric or Excel to create graphs.
OpenSuse 11: here
After downloading the rpm file, install it using command: rpm -ivh dstat-0.6.8-3.1.noarch.rpm
Using dstat to relate disk-throughput with network-usage (eth0), total CPU-usage and system counters:
dstat -dnyc -N eth0 -C total -f 5
Checking dstat's behaviour and the system's impact on dstat:
dstat -taf --debug
Using the time plugin together with cpu, net, disk, system, load, proc and topcpu plugins:
dstat -tcndylp -M topcpu
this is identical to: dstat -M time,cpu,net,disk,sys,load,proc,topcpu
Using dstat to relate cpu stats with interrupts per device:
Get a Report by Mail
There may be cases wherein you want to observe how your server is performing over a period of time. You can setup a background process in Linux that will give you a reading with a certain interval, generate a report, and mail out the file to you.
The following script will run Dstat for three hours, reading the data every 30 seconds, and will mail out the report to email@example.com.
dstat –output /tmp/dstat_data_mail.csv -CDN 30 360
mutt -a /tmp/dstat_data_mail.csv -s “Dstat Report for 3 hour run” firstname.lastname@example.org < /dev/null
Save the above script in a file called dstat_script.sh on your server, give it executable permission and then run it as a background process:
# chmod +x dstat_script.sh
# nohup ./dstat_script.sh &
Done. Yes, it’s that simple. You will now be mailed this report after it’s done running. You can optionally schedule this script as a daily cron job so that you can receive this data every day.