全部博文(346)
分类:
2010-03-03 13:17:25
一、查看cpu
1、psrinfo -v
psrinfo -vp
查看cpu个数和主频
如:
bash-2.03# psrinfo -v
Status of processor 0 as of: 10/27/09 10:14:37
Processor has been on-line since 10/22/09 15:16:33.
The sparcv9 processor operates at 550 MHz,
and has a sparcv9 floating point processor.bash-3.00# psrinfo -v
虚拟处理器 0 在下列时间的状态:10/27/2009 11:08:52
自 10/27/2009 10:57:50 开始已在运行。
i386 处理器以 1800 MHz 运行,
而且有 i387 compatible 浮点数处理器
虚拟处理器 1 在下列时间的状态:10/27/2009 11:08:52
自 10/27/2009 10:57:54 开始已在运行。
i386 处理器以 1800 MHz 运行,
而且有 i387 compatible 浮点数处理器
2、mpstat
mpstat 1 5 (间隔1秒5次)
查看cpu个数和负载
如:
bash-2.03# mpstat
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 0 0 0 401 301 96 0 0 0 0 16 0 1 0 99bash-3.00# mpstat
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 114 2 11 432 270 190 4 10 5 0 405 1 5 0 94
1 164 5 16 68 2 210 6 10 12 0 501 1 2 0 97
3、isalist
显示处理器类型
如:
bash-2.03# isalist
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparcbash-3.00# isalist
pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
4、vmstat
显示cpu总体性能
如:
bash-2.03# vmstat 1 3
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr dd f0 s0 -- in sy cs us sy id
0 0 0 578896 57680 0 0 0 0 0 0 0 0 0 0 0 301 16 96 0 1 99
0 0 0 577856 56024 4 10 0 0 0 0 0 0 0 0 0 310 13 101 1 1 98
0 0 0 577856 56024 0 0 0 0 0 0 0 0 0 0 0 305 10 98 0 0 100bash-3.00# vmstat 1 3
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr cd f0 s0 -- in sy cs us sy id
0 0 0 762220 278340 21 101 35 0 0 0 28 4 0 0 0 448 390 237 1 2 98
0 0 0 758600 272356 0 43 0 0 0 0 0 0 0 0 0 457 189 155 0 1 98
0 0 0 758600 272356 0 0 0 0 0 0 0 0 0 0 0 441 140 149 0 1 99
5、uptime
显示系统运行时间和负载
如:
bash-2.03# uptime
下午 1点18分 运行 4 天 22:02, 1 user, 平均负载:0.00, 0.03, 0.05
6、sar 1 3
显示默认cpu负载
如:
bash-2.03# sar 1 3
SunOS collecting01 5.8 Generic_108528-13 sun4u 10/27/09
13:23:10 %usr %sys %wio %idle
13:23:11 0 5 0 95
13:23:12 0 12 0 88
13:23:13 0 4 0 96Average 0 7 0 93
7、prstat
显示进程使用cpu情况,类似top命令
如:
bash-2.03# prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
1537 root 2424K 1544K cpu0 58 0 0:00.01 0.7% prstat/1
256 root 3240K 2600K sleep 58 0 0:00.00 0.2% nscd/10
634 root 2480K 1944K sleep 58 0 0:00.00 0.1% mibiisa/12
85 root 2480K 2024K sleep 32 0 0:00.00 0.0% picld/9
377 root 5312K 3192K sleep 59 0 0:00.00 0.0% kkcv/1
376 root 4944K 2832K sleep 59 0 0:00.00 0.0% ccv/1
374 root 936K 664K sleep 22 0 0:00.00 0.0% cssd/1
375 root 2832K 1704K sleep 58 0 0:00.00 0.0% cs00/1
304 root 1016K 680K sleep 59 0 0:00.00 0.0% utmpd/1
450 root 1672K 592K sleep 50 0 0:00.00 0.0% rk6d/1
294 nobody 2616K 1864K sleep 58 0 0:31.47 0.0% lmgrd.ste/1
629 root 1760K 1072K sleep 58 0 0:00.00 0.0% sac/1
Total: 52 processes, 146 lwps, load averages: 0.00, 0.01, 0.04
8、dmesg |grep cpu
显示cpu个数和主频
二、查看内存
1、prtconf |grep Memory
显示内存大小
如:
bash-2.03# prtconf |grep Memory
Memory size: 128 Megabytes
2、prstat -t
显示内存使用情况
如:
bash-2.03# prstat -t
NPROC USERNAME SIZE RSS MEMORY TIME CPU
45 root 104M 62M 53% 0:00.15 0.6%
3 daemon 22M 9600K 8.0% 0:00.00 0.0%
4 nobody 6456K 4824K 4.0% 0:31.47 0.0%Total: 52 processes, 146 lwps, load averages: 0.00, 0.00, 0.01
3、dmesg |grep mem
显示内存大小
如:
bash-3.00# dmesg |grep mem
Oct 27 10:57:48 solaris10 unix: [ID 168242 kern.info] mem = 523836K (0x1ff8f000)
4、/usr/platform/sun4u/sbin/prtdiag
显示内存大小和个数及服务器型号
如:
bash-2.03# /usr/platform/sun4u/sbin/prtdiag
System Configuration: Sun Microsystems sun4u Sun Blade 150 (UltraSPARC-IIe 550MHz)
System clock frequency: 92 MHZ
Memory size: 128MB==================================== CPUs ====================================
E$ CPU CPU Temperature
CPU Freq Size Impl. Mask Die Ambient
--- -------- ---------- ------ ---- -------- --------
0 550 MHz 512KB US-IIe 3.3 35 C 30 C================================= IO Devices =================================
Bus Freq
Brd Type MHz Slot Name Model
--- ---- ---- ---------- -------------------------------- ----------------------
0 pci 33 7 isa/dma-isadma (dma)
0 pci 33 7 isa/serial-su16550 (serial)
0 pci 33 7 isa/serial-su16550 (serial)
0 pci 33 8 sound-pci10b9,5451.10b9.5451.1 (+
0 pci 33 12 network-pci108e,1101.1 (network) SUNW,pci-eri
0 pci 33 12 firewire-pci108e,1102.1001 (fire+
0 pci 33 13 ide-pci10b9,5229.c3 (ide)
0 pci 33 19 SUNW,m64B (display) ATY,RageXL============================ Memory Configuration ============================
Segment Table:
-----------------------------------------------------------------------
Base Address Size Interleave Factor Contains
-----------------------------------------------------------------------
0x0 128MB 1 Label DIMM0=============================== usb Devices ===============================
Name Port#
------------ -----
keyboard 2
5、swap -s
显示虚拟内存大小
如:
bash-2.03# swap -s
总数:分配了 26664k 字节 + 保留 5992k = 已使用 32656k,576424k 可用
6、vmstat 1 5
显示虚拟内存大小
如:
bash-2.03# vmstat 5
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr dd f0 s0 -- in sy cs us sy id
0 0 0 578880 57640 0 0 0 0 0 0 0 0 0 0 0 301 16 96 0 1 99
0 0 0 576400 51456 0 2 0 0 0 0 0 0 0 0 0 303 76 99 1 2 98
0 0 0 576400 51456 0 0 0 0 0 0 0 0 0 0 0 302 7 96 0 0 100
0 0 0 576400 51456 0 0 0 0 0 0 0 0 0 0 0 303 8 96 0 2 98
0 0 0 576400 51456 0 0 0 0 0 0 0 0 0 0 0 302 13 98 0 0 100
7、sar -r 1 3
查看内存使用情况
如:
bash-2.03# sar -r 1 3
SunOS collecting01 5.8 Generic_108528-13 sun4u 10/28/09
15:00:43 freemem freeswap
15:00:44 6100 1097387
15:00:45 6155 1107939
15:00:46 6215 1118695Average 6156 1107939
8、df -k,format
查看磁盘虚拟内存大小
如:
partition> p
Current partition table (original):
Total disk cylinders available: 19156 + 2 (reserved cylinders)Part Tag Flag Cylinders Size Blocks
0 root wm 258 - 4273 7.81GB (4016/0/0) 16385280
1 swap wu 0 - 257 513.98MB (258/0/0) 1052640
2 backup wm 0 - 19155 37.27GB (19156/0/0) 78156480
3 usr wm 4274 - 6783 4.88GB (2510/0/0) 10240800
4 var wm 6784 - 9293 4.88GB (2510/0/0) 10240800
5 home wm 9294 - 13309 7.81GB (4016/0/0) 16385280
6 unassigned wm 13310 - 15141 3.56GB (1832/0/0) 7474560
7 home wm 15142 - 19155 7.81GB (4014/0/0) 16377120
三、查看硬盘
1、format
查看硬盘型号和分区情况
如:
bash-2.03# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
2、iostat -E
查看硬盘型号和大小
如:
bash-2.03# iostat -E
dad0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Model: ST340014A Revision: 3.04 Serial No: 5JX3QPCZ
Size: 40.02GB <40018206720 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0
sd0 Soft Errors: 0 Hard Errors: 2 Transport Errors: 0
Vendor: LITEON Product: CD-ROM LTN486S Revision: Y3S2 Serial No:
Size: 18446744073.71GB <-1 bytes>
Media Error: 0 Device Not Ready: 2 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
3、prtvtoc /dev/rdsk/c0t0d0s0
显示磁盘分区情况
如:
bash-2.03# prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 255 sectors/track
* 16 tracks/cylinder
* 4080 sectors/cylinder
* 19158 cylinders
* 19156 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 1052640 16385280 17437919 /
1 3 01 0 1052640 1052639
2 5 00 0 78156480 78156479
3 4 00 17437920 10240800 27678719 /usr
4 7 00 27678720 10240800 37919519 /var
5 8 00 37919520 16385280 54304799
6 0 00 54304800 7474560 61779359 /opt
7 8 00 61779360 16377120 78156479 /export/home
4、df -k
显示分区使用情况
如:
bash-2.03# df -k
文件系统 千字节 用了 可用 容量 挂接在
/dev/dsk/c0t0d0s0 8066141 268781 7716699 4% /
/dev/dsk/c0t0d0s3 5041230 1694459 3296359 34% /usr
/proc 0 0 0 0% /proc
fd 0 0 0 0% /dev/fd
mnttab 0 0 0 0% /etc/mnttab
/dev/dsk/c0t0d0s4 5041230 127283 4863535 3% /var
swap 574416 16 574400 1% /var/run
swap 574424 24 574400 1% /tmp
/dev/dsk/c0t0d0s6 3679326 514807 3127726 15% /opt
/dev/dsk/c0t0d0s7 8062061 3047943 4933498 39% /export/home
5、metastat
显示硬盘raid状态
6、iostat -xtc
显示硬盘读写情况
如:
bash-2.03# iostat -xtc
extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
dad0 0.0 0.0 0.5 0.1 0.0 0.0 31.0 0 0 0 1 0 1 0 99
fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
nfs1 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
以下列表描述了输出字段。
r/s 每秒读取次数
w/s 每秒写入次数
kr/s 每秒读取的千字节数
kw/s 每秒写入的千字节数
wait 等待服务的平均事务数(队列长度)
actv 处于活动服务状态的平均事务数
svc_t 平均服务时间,以毫秒为单位
%w 队列不为空的时间百分比
%b 磁盘繁忙的时间百分比
四、查看网卡
1、ifconfig -a
查看网卡数和IP地址
# ifconfig eri0 unplumb --停止网卡
# ifconfig eri0 plumb --起用网卡
# ifconfig eri0 inet 192.168.0.209 netmask 255.255.255.0 up --添加ip、子网掩码
2、dmesg |grep link
查看网卡速率、双工和状态
如:
bash-2.03# dmesg |grep link
Oct 22 15:16:44 collecting01 eri: [ID 517527 kern.info] SUNW,eri0 : 100 Mbps full duplex link up
3、dladm show-dev
显示系统已安装网卡设备
如:
7、more path_to_inst |grep network
查看网卡个数和别名
如:
bash-2.03# more path_to_inst |grep network
"/pci@1f,0/network@c,1" 0 "eri"
chinaunix网友2010-03-08 16:12:06
如果您有一技之长,请到淘师宝发帖子收徒弟; 如果您想学习一门技能,请到淘师宝发帖子拜师傅; 拜师傅,收徒弟,到淘师宝,网址:www.taoshibao.com