Use Dstat to monitor your server – Ubuntu

Posted by | Posted in Command-Line, Linux, Ubuntu | Posted on 21-07-2009

Dstat is one of the best tools you can use for monitoring your server during peak times. It is a combination of vmstat, iostat, netstat, nfsstat and ifstat. This program allows you to access and view key elements of your system’s resources instantly.

dstat – versatile tool for generating system resource statistics

dstat [-afv] [options..] [delay [count]]

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:
 
       dstat -tcyif

Installing Dstat

sudo apt-get install dstat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  dstat
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 58.0kB of archives.
After this operation, 406kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com jaunty/universe dstat 0.6.8-1 [58.0kB]
Fetched 58.0kB in 1s (50.0kB/s)
Selecting previously deselected package dstat.
(Reading database ... 24720 files and directories currently installed.)
Unpacking dstat (from .../archives/dstat_0.6.8-1_all.deb) ...
Processing triggers for man-db ...
Setting up dstat (0.6.8-1) ...

Dstat updates every second to display its information. Use “control C” to quit the application.

$ dstat
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
  0   0 100   0   0   0|  13k   29k|   0     0 |   0     0 |   7    12 
  0   1  99   0   0   0|  32k    0 | 418B  404B|   0     0 |  11    14 
  0   0 100   0   0   0|   0     0 |1360B  420B|   0     0 |  17    14 
  0   0  99   1   0   0|   0   856k| 132B  420B|   0     0 |  22    22 
  0   0 100   0   0   0|   0     0 | 132B  420B|   0     0 |  10    14 
  0   0 100   0   0   0|   0     0 | 192B  420B|   0     0 |  12    16 ^C

A screen shot of the unmodified output of dstat:

Picture 9

Family Commands for dstat:

    Performance tools
       ifstat(1), iftop(8), iostat(1), mpstat(1), netstat(1), nfsstat(1), nstat, vmstat(1), xosview(1)
 
   Debugging tools
       htop(1), lslk(1), lsof(8), top(1)
 
   Process tracing
       ltrace(1), pmap(1), ps(1), pstack(1), strace(1)
 
   Binary debugging
       ldd(1), file(1), nm(1), objdump(1), readelf(1)
 
   Memory usage tools
       free(1), memusage, memusagestat, slabtop(1)
 
   Accounting tools
       dump-acct, dump-utmp, sa(8)
 
   Hardware debugging tools
       dmidecode, ifinfo(1), lsdev(1), lshal(1), lshw(1), lsmod(8), lspci(8), lsusb(8), smartctl(8), x86info(1)
 
   Application debugging
       mailstats(8), qshape(1)
 
   Xorg related tools
       xdpyinfo(1), xrestop(1)
 
   Other useful info
       proc(5)

Join the mailing list

Check your email and confirm the subscription