Install dstat Monitoring tool on Ubuntu Linux system. Dstat allows you to view all of your system resources in real-time. Dstat is a versatile replacement for vmstat, iostat, netstat and ifstat. Dstat overcomes some of their limitations and adds some extra features, more counters and flexibility. Dstat is handy for monitoring systems during performance tuning tests, benchmarks or troubleshooting.
Dstat allows you to view all of your system resources in real-time, you can eg. compare disk utilization in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).
Features
- Combines vmstat, iostat, ifstat, netstat information and more
- Shows stats in exactly the same timeframe
- Enable/order counters as they make most sense during analysis/troubleshooting
- Modular design
- Written in python so easily extendable for the task at hand
- Easy to extend, add your own counters (please contribute those)
- Includes many external plugins to show how easy it is to add counters
- Can summarize grouped block/network devices and give total numbers
- Can show interrupts per device
- Very accurate timeframes, no timeshifts when system is stressed
- Shows exact units and limits conversion mistakes
- Indicate different units with different colors
- Show intermediate results when delay > 1
- Allows to export CSV output, which can be imported in Gnumeric and Excel to make graphs
Install Dstat on Ubuntu
Dstat can be installed on Ubuntu Systems using the command given below:
sudo apt-get install dstat
Using Dstat
Once installed, dstat can easily be used. There are many command options that can be used with dstat command. Below is the list of command options for dstat:
- -c, –cpu enable cpu stats
- -C 0,3,total include cpu0, cpu3 and total
- -d, –disk enable disk stats
- -D total,hda include hda and total
- -g, –page enable page stats
- -i, –int enable interrupt stats
- -I 5,eth2 include int5 and interrupt used by eth2
- -l, –load enable load stats
- -m, –mem enable memory stats
- -n, –net enable network stats
- -N eth1,total include eth1 and total
- -p, –proc enable process stats
- -r, –io enable io stats (I/O requests completed)
- -s, –swap enable swap stats
- -S swap1,total include swap1 and total
- -t, –time enable time/date output
- -T, –epoch enable time counter (seconds since epoch)
- -y, –sys enable system stats
- –list list all available plugins
- -a, –all equals -cdngy (default)
- -f, –full automatically expand -C, -D, -I, -N and -S lists
- -v, –vmstat equals -pmgdsc -D total
- –output file write CSV output to file
delay is the delay in seconds between each update (default: 1)
count is the number of updates to display before exiting (default: unlimited)
Example of Dstat
In the most basic form, dstat can be used alone without any arguments or options.
dstat
The dstat command without any options uses –cdngy by default.
-c, –cpu enable cpu stats
-d, –disk enable disk stats
-n, –net enable network stats
-g, –page enable page stats
-y, –sys enable system stats
Dstat can also be used with various command options:
dstat –vmstat
Other examples are:
dstat -c –top-cpu -dn –top-mem
dstat -c –top-cpu -d –top-bio –top-latency
The above command shows process using most CPU and process using most memory.
The dstat gives detailed selective information in columns and clearly indicates in what unit the output is displayed. The output by default is designed for being interpreted by humans in real-time, however the result can also be exported to CSV output to a file.
More info on http://dag.wiee.rs/home-made/dstat/