上篇博文介紹了vmstat等工具的使用,在此繼續介紹其他工具,此篇主要涉及2個工具nicstat和dstat,nicstat在之前有過詳細介紹,具體請看nicstat的安裝及使用,在此就不再重複了。下面來看dstat。
8> nicstat:網絡流量監控利器.請移步至:nicstat的安裝及使用
9> dstat:通用的系統資源統計工具
用法:
dstat [-afv] [options..] [delay [count]]
描述:
Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations and adds some extra features.
選項:
-c,--cpu #顯示CPU狀態(system, user, idle, wait, hardware interrupt, software interrupt) -C 0,3,total #指定其中一個CPU的狀態或者全部 -d,--disk #顯示磁盤狀態(read, write) -D total,sda #指定其中一個磁盤的狀態或者全部的 -g,--page #顯示page狀態(page in, page out) -i,--int #顯示interrupt(中斷)狀態 -l,--load #顯示平均負載(1 min, 5 mins, 15mins) -m,--mem #顯示內存狀態(used, buffers, cache, free) -n,--net #網絡狀態(receive, send) -N eth1,total #指定相應的網卡設備或全部 -p,--proc #線程狀態 (runnable, uninterruptible, new) -r,--io #IO狀態(read, write requests) -s,--swap #交換空間狀態(used, free) -S swap1,total #include swap1 and total (when using -s/--swap) -t,--time #打印出來時間 -T,--epoch #打印出時間計算器(seconds since epoch) -y,--sys #系統狀態(interrupts, context switches --aio #異步I/O狀態(asynchronous I/O) --fs #文件系統(open files, inodes) --ipc #enable ipc stats (message queue, semaphores, shared memory) --lock #文件鎖 (posix, flock, read, write) --raw #enable raw stats (raw sockets) --socket #套接字狀態(total, tcp, udp, raw, ip-fragments) --tcp #enable tcp stats (listen, established, syn, time_wait, close) --udp #enable udp stats (listen, active) --unix #enable unix stats (datagram, stream, listen, active) --vm #enable vm stats (hard pagefaults, soft pagefaults, allocated, free) --plugin-name #enable (external) plugins by plugin name, see PLUGINS for options --list #顯示內部和外部的插件名字 -a,--all #等同於-cdngy (default) -f,--full #等同於-C, -D, -I, -N and -S discovery lists -v,--vmstat #等同於-pmgdsc -D total --float #force float values on screen (mutual exclusive with --integer) --integer #force integer values on screen (mutual exclusive with --float) --bw,--blackonwhite #change colors for white background terminal --nocolor #disable colors (implies --noupdate) --noheaders #disable repetitive headers --noupdate #disable intermediate updates when delay > 1 --output file #導出結果CSV文件 --profile #show profiling statistics when exiting dstat
更多還有關於插件選項的使用及意義請參照官網手冊http://dag.wieers.com/home-made/dstat/#documentation或$ man dstat
示例:(詳情參照以上)
$ dstat $ dstat 2 3 $ dstat -c 2 3 $ dstat --output abc.csv -c 2 3
到此:基礎篇的工具基本已介紹完畢,其包含uptime top or htop mpstat iostat vmstat free ping nicstat dstat,之後總結時可能會做一個索引,方便查看。另後面會繼續介紹中級篇的相關分析工具。