dstat for Linux: an alternative to sar/vmstat/iostst/etc.:

Written in python, dstat is a neat piece of tooling. It is a monitoring tool akin to sar, iostat, vmstat, etc. It allows you to measure a host of metrics. You can install it on any modern ubuntu box by typing “apt-get install dstat” (and I am sure it is available for any major distro).

By just typing dstat, you’ll get this (refreshed every second):

dstat1 output

There is quite some options:

Dstat options:
-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
-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
--ipc                  enable ipc stats
--lock                 enable lock stats
--raw                  enable raw stats
--tcp                  enable tcp stats
--udp                  enable udp stats
--unix                 enable unix stats
-M stat1,stat2         enable external stats
--mods stat1,stat2
-a, --all              equals -cdngy (default)
-f, --full             expand -C, -D, -I, -N and -S discovery lists
-v, --vmstat           equals -pmgdsc -D total
--integer              show integer values
--nocolor              disable colors (implies --noupdate)
--noheaders            disable repetitive headers
--noupdate             disable intermediate updates
--output file          write CSV output to file

For example, “dstat -mp” will show memory and process related metrics with a refresh rate of one second (the delay is tweakable):

dstat example 2

Last but not least, you can export the output to CSV.

What I find especially neat is that you can combine any metrics with any other metrics (a bit more difficult to do with sar for instance).

0 Responses to “dstat for Linux: an alternative to sar/vmstat/iostst/etc.:”

  • No Comments

Leave a Reply