4).同时增加内存与网络的显示信息:
[root@twexdb1 qzhijun]# collectl -s+mn
waiting for 1 second sample...
#
#cpu sys inter ctxsw Free Buff Cach Inac Slab Map KBRead Reads KBWrit Writes KBIn PktIn KBOut PktOut
0 0 1032 554 116M 270M 5G 5G 224M 1G 0 0 352 9 4 40 11 35
0 0 1032 180 116M 270M 5G 5G 224M 1G 0 0 0 0 1 11 2 12
0 0 1026 174 116M 270M 5G 5G 224M 1G 8 16 1 1 1 4 1 6
0 0 1032 177 116M 270M 5G 5G 224M 1G 0 0 0 0 1 4 1 7
Ouch!
5).在默认显示信息的基础上减去CPU的信息:
[root@twexdb1 qzhijun]# collectl -s-c
waiting for 1 second sample...
#
#KBRead Reads KBWrit Writes KBIn PktIn KBOut PktOut
8 16 1 1 29 278 52 230
0 0 0 0 50 556 69 463
0 0 20 3 6 49 14 46
0 0 1516 81 74 675 235 603
8 16 337 8 2 18 8 21
0 0 0 0 1 4 1 6
Ouch!
2.显示详细子系统指定项目信息:
[root@twexdb1 qzhijun]# collectl -sD
waiting for 1 second sample...
# DISK STATISTICS (/sec)
# Pct
#Name KBytes Merged IOs Size KBytes Merged IOs Size RWSize QLen Wait SvcTim Util
c0d0 0 0 0 0 0 0 0 0 0 0 0 0 0
sda 8 0 16 1 0 0 1 1 0 1 0 0 0
sdb 0 0 0 0 44 5 6 7 7 2 0 0 0
sdc 0 0 0 0 0 0 0 0 0 0 0 0 0
dm-0 8 0 16 1 0 0 1 1 0 1 0 0 0
dm-1 0 0 0 0 44 0 11 4 4 4 0 0 0
dm-2 0 0 0 0 0 0 0 0 0 0 0 0 0
dm-3 0 0 0 0 0 0 0 0 0 0 0 0 0
c0d0 0 0 0 0 0 0 0 0 0 0 0 0 0
还可以指定特定的磁盘:--dskfilt
[root@twexdb1 qzhijun]# collectl -sD --dskfilt sdb
waiting for 1 second sample...
监控某个特定的进程:
[root@twexdb1 qzhijun]# collectl -sZ --procfilt Cmysql --procopts c
waiting for 60 second sample...
# PROCESS SUMMARY (counters are /sec)
# PID User PR PPID THRD S VSZ RSS CP SysT UsrT Pct AccuTime MajF MinF Command
6839 root 18 1 0 S 10M 1M 3 0.00 0.00 0 00:00.09 0 0 /bin/sh
7002 mysql 14 6839 300 S 2G 1G 15 0.18 3.96 6 728:25:39 0 0 /usr/local/mysql/bin/mysqld
Ouch!
# DISK STATISTICS (/sec)
# Pct
#Name KBytes Merged IOs Size KBytes Merged IOs Size RWSize QLen Wait SvcTim Util
sdb 0 0 0 0 0 0 0 0 0 0 0 0 0
sdb 0 0 0 0 0 0 0 0 0 0 0 0 0
sdb 0 0 0 0 0 0 0 0 0 0 0 0 0
sdb 0 0 0 0 0 0 0 0 0 0 0 0 0
sdb 0 0 0 0 0 0 0 0 0 0 0 0 0
Ouch!
--procfilt Process Filters
c - substring of the command being executed as explicitly read from /proc/pid/stat. Note that this can actually be a perl expression, so if you
want a command that ends in a particular string all you need to is append a to the end of the string. Otherwise it would match any commands con-
taining that string.
C - any command that starts with the specified string
f - full path of the command, including arguments, as read from /proc/pid/cmdline. Like the c modifier this too can be a perl expression.
p - pid
P - parent pid
u - any process ownerd by this user’s UID or in the range specifide by uxxx-yyy
U - any process owned by this username
--top 类似以linux下面的top工具那样实时显示.
如:
collectl -sCj --top
--iosize :显示平均的I/O大小(多了Size字段)
显示时间戳:
-oT 显示时间
-oD 显示日期和时间
-oDm 显示日期时间和毫秒
-i 指定监控时间间隔(以秒为单位)
[root@twexdb1 qzhijun]# collectl -sm -i 2
waiting for 2 second sample...
#
#Free Buff Cach Inac Slab Map
120M 276M 5G 5G 224M 1G
120M 276M 5G 5G 224M 1G
120M 276M 5G 5G 224M 1G
120M 276M 5G 5G 224M 1G
121M 276M 5G 5G 224M 1G
121M 276M 5G 5G 223M 1G