`

linux常用工具诊断工具使用示例1

 
阅读更多

我使用的ubutun,安装用apt-get非常方便。

 

weijianzhongwj@ubuntu:~$ dstat
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
 16   5  77   2   0   1| 181k  147k|   0     0 |1439B 6319B|1234  6234 
  1   1  95   3   0   0|   0    92k|   0     0 |   0     0 | 814   999 
  2   1  97   0   0   1|   0     0 |   0     0 |   0     0 | 821   966 
  1   1  98   0   0   0|   0     0 |   0    86B|   0     0 | 802   798 
  1   0  98   0   0   0|   0     0 |   0     0 |   0     0 | 781   742 
  2   1  98   0   0   0|   0     0 |   0     0 |   0     0 | 801   834 
  1   1  95   3   0   1|   0   104k|5591B 3433B|   0     0 | 876  1239 
  1   1  98   0   0   0|   0     0 | 658B 2023B|   0     0 | 829   911 ^C
weijianzhongwj@ubuntu:~$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0  61876 125672 427420 491748    0    2    68    69  308  571 16  5 77  2
 0  0  61876 125672 427464 491704    0    0     0   176  358 1042  1  1 95  3
 0  0  61876 125528 427464 491748    0    0     0     0  347  750  2  1 97  0
 0  0  61876 125480 427464 491748    0    0     0     0  679  737  2  1 98  0
 0  0  61876 125376 427464 491748    0    0     0    12  771  706  1  1 99  0
^C
weijianzhongwj@ubuntu:~$ iostat 
Linux 3.5.0-17-generic (ubuntu) 	2012年11月05日 	_i686_	(4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          15.52    0.01    5.45    1.89    0.00   77.13

Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sda              12.38       181.16       147.01    1974352    1602164

weijianzhongwj@ubuntu:~$ ifstat
       eth0               wlan0       
 KB/s in  KB/s out   KB/s in  KB/s out
    0.00      0.00      0.00      0.00
    0.00      0.00      0.00      0.00
    0.00      0.00      0.00      0.09
    0.00      0.00      0.00      0.00
    0.00      0.00      0.00      0.00
    0.00      0.00      0.00      0.00
^C

 

 

dstat系统资源检测工具,可以统计的数据包括

 

OPTIONS
       -c, --cpu
              enable cpu stats (system, user, idle, wait, hardware interrupt, software interrupt)

       -C 0,3,total
              include cpu0, cpu3 and total (when using -c/--cpu)

       -d, --disk
              enable disk stats (read, write)

       -D total,hda
              include total and hda (when using -d/--disk)

       -g, --page
              enable page stats (page in, page out)

       -i, --int
              enable interrupt stats

       -I 5,10
              include interrupt 5 and 10 (when using -i/--int)

       -l, --load
              enable load average stats (1 min, 5 mins, 15mins)

       -m, --mem
              enable memory stats (used, buffers, cache, free)

       -n, --net
              enable network stats (receive, send)

       -N eth1,total
              include eth1 and total (when using -n/--net)

       -p, --proc
              enable process stats (runnable, uninterruptible, new)
 -r, --io
              enable I/O request stats (read, write requests)

       -s, --swap
              enable swap stats (used, free)

       -S swap1,total
              include swap1 and total (when using -s/--swap)

       -t, --time
              enable time/date output

       -T, --epoch
              enable time counter (seconds since epoch)

       -y, --sys
              enable system stats (interrupts, context switches)

       --aio  enable aio stats (asynchronous I/O)

       --fs   enable filesystem stats (open files, inodes)

       --ipc  enable ipc stats (message queue, semaphores, shared memory)

       --lock enable file lock stats (posix, flock, read, write)

       --raw  enable raw stats (raw sockets)

       --socket
              enable socket stats (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

       Possible internal stats are
              aio, cpu, cpu24, disk, disk24, disk24old, epoch, fs, int, int24, io, ipc, load, lock, mem, net, page, page24, proc, raw,
              socket, swap, swapold, sys, tcp, time, udp, unix, vm

       --list list the internal and external plugin names

       -a, --all
              equals -cdngy (default)

       -f, --full
              expand -C, -D, -I, -N and -S discovery lists

       -v, --vmstat
              equals -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
              write CSV output to file

       --profile
              show profiling statistics when exiting dstat

 

 比如:

 

weijianzhongwj@ubuntu:~$ dstat --fs
--filesystem-
files  inodes
 8800  21186 
 8640  20966 
 8640  20966 
 8640  20968 ^C
weijianzhongwj@ubuntu:~$ dstat -T
--epoch---
  epoch   
1352126322
1352126323
1352126324
1352126325^C
weijianzhongwj@ubuntu:~$ dstat --ipc
--sysv-ipc-
msg sem shm
  0   1  31
  0   1  31
  0   1  31
  0   1  30^C
weijianzhongwj@ubuntu:~$ dstat --socket
------sockets------
tot tcp udp raw frg
676  10   5   0   0
676  10   5   0   0
673   7   5   0   0
673   7   5   0   0
673   7   5   0   0
673   7   5   0   0
673   7   5   0   0^C

 

 

ifstat是统计所有网卡的输入输出流量的。

vmstat主要统计的就是内存的使用情况了。

iostat统计的就是硬盘的读写情况。

分享到:
评论

相关推荐

    基于OPENCV+C#+C++开发的视觉检测软件框架,集成了部分常用功能.zip

    OpenCV拥有丰富的官方文档、教程、示例代码以及活跃的开发者社区,包括GitHub、StackOverflow、官方论坛等,为学习和使用OpenCV提供了有力支持。此外,有许多书籍、在线课程、博客文章和研讨会专门讲解OpenCV的使用...

    MYSQL中文手册

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8....

    mysql官方中文参考手册

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySQL 5.1参考手册中文版

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8....

    MySQL 5.1参考手册

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySQL 5.1参考手册 (中文版)

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySQL 5.1中文手冊

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySql 5.1 参考手册.chm

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySQL5.1参考手册官方简体中文版

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    MySQL 5.1官方简体中文参考手册

    3.6. 常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键搜索 3.6.8. 根据天...

    mysql5.1中文手册

    常用查询的例子 3.6.1. 列的最大值 3.6.2. 拥有某个列的最大值的行 3.6.3. 列的最大值:按组 3.6.4. 拥有某个字段的组间最大值的行 3.6.5. 使用用户变量 3.6.6. 使用外键 3.6.7. 根据两个键...

    网管教程 从入门到精通软件篇.txt

    Windows XP(包括 Windows 2000)的控制台命令是在系统出现一些意外情况下的一种非常有效的诊断和测试以及恢复系统功能的工具。小编的确一直都想把这方面的命令做个总结,这次辛苦老范给我们整理了这份实用的秘笈。 ...

Global site tag (gtag.js) - Google Analytics