Five Resources and Performance of Common Command Skills under UNIX Platform
Li Shouliang SLLI@founder.com.cn
Lastversion 2003-03-10
Brief description
This section describes some tools for viewing system information and monitoring system resources and performance. Using performance monitoring tools have a basic understanding of the current system, selecting other corresponding tools based on the collected information, further separating performance bottlenecks and looking for resolution Method. This section describes several performance monitoring tools and monitoring methods based on viewing system information, disk usage, and I / O monitoring, CPU and memory monitoring, network monitoring, introduces several performance monitoring tools and monitoring methods for everyone to choose a reference in daily work.
table of Contents
First, system information view
1. View a few commands in the system version number
2, how to get a memory size under Solaris
3, how to get the CPU rate under Solaris
Second, disk use and I / O monitoring
1. Check disk usage tools DF, DU
2, iostat monitor disk command
Third, CPU and memory use monitoring
1. Monit the CPU and memory, and the properties listed by VMSTAT are detailed.
2, PRSTAT gives a dynamic annotation of CPU and memory usage
3, MPSTAT command reports statistics for each processor
4, Proc Tool Reports a single process property
5, PMAP command reports the memory space layout of individual processes
6. Use the PS command to get the memory, CPU utilization status and sorting
7, uptime and w command View the load situation of the system in the past 15 minutes
8, use TOP tool monitoring performance
9, how to increase the switch space
Fourth, check network performance tools
1, Snoop Diagnostics Network Packet Tool
2, NFSSTAT monitoring NFS system
3, NetStat monitoring network interface
4. How do you know which process uses which port under Solaris?
5, ping diagnostic network connection and blocking problem
6, IPCS displays statistics related to internal process communication
7. Traceroute displays a packet to the destination owner, diagnosis network congestion
8, Route Get IP Get the gateway passed by
content
First, system information view
============================================================================================================================================================================================================= ======================
1. View a few commands in the system version number
1) Look at the version number
# uname -a
Sunos SunServer1 5.8 Generic_108528-13 Sun4u Sparc SUNW, Sun-fire-280R
2) See the Kernel version number
# swrev
Hostname: SunServer1
Hostid: 8318005d
RELEASE: 5.8
KERNEL Architecture: Sun4u
Application Architecture: SPARC
Hardware Provider: Sun_Microsystems
Domain:
KERNEL VERSION: SunOS 5.8 Generic 108528-19 January 2003
Related commands:
#hostid
#hostname
3) Look at the installed patch ID
#ShowRev -p
4) See if a patch is installed
#pkginfo | GREP XXXXX
============================================================================================================================================================================================================= ====================== 2, how to get a memory size under Solaris
There are several orders for reference:
/ usr / platform / `uname -m` / sbin / prtdiag -v | grep memory
Prtconf -v | grep memory
If the GNU Top is installed, you can also use the top command directly.
============================================================================================================================================================================================================= ======================
3, how to get the CPU rate under Solaris
There are several orders for reference:
# psrinfo -v
# psrinfo | grep on-line | WC -L simply gives the number of CPUs
# / usr / platform / `uname -i` / sbin / prtdiag -v
# / usr / platform / `uname -m` / sbin / prtdiag -v
# / usr / bin / netstat -k cpu_info0
============================================================================================================================================================================================================= ======================
Second, disk use and I / O monitoring
============================================================================================================================================================================================================= ====================== 1, check the disk usage tool DF, DU
DF lists the block size, and usage of file systems
# df
/ (/ DEV / DSK / C0T0D0S0): 745246 block 667064 file
/ proc (/ proc): 0 block 7816 file
/ DEV / FD (FD): 0 block 0 file
/ etc / mnttab: 0 block 0 file
/ VAR / RUN (SWAP): 1227264 Block 54271 File
/ TMP (SWAP): 1227264 block 54271 file
/ Space (/ dev / dsk / c0t0d0s3): 2023574 block 1470851 file
DF -K lists system usage by bytes
# df -k
The file system kiloby is used to use the available capacity
/ DEV / DSK / C0T0D0S0 6191949 5819326 310704 95% /
/ proc 0 0 0 0% / proc
FD 0 0 0 0% / DEV / FD
MNTTAB 0 0 0 0% / etc / mnttab
SWAP 488768 0 488768 0% / VAR / RUN
SWAP 490240 1472 488768 1% / TMP
/ DEV / DSK / C0T0D0S3 12530787 11518984 886496 93% / Space
List the device usage of a certain directory
# DF -K / SLLI
The file system kiloby is used to use the available capacity
/ DEV / DSK / C0T0D0S0 6191949 5819326 310704 95% /
Du lists the size of the use of a directory
# du -s / export / home
852690 / export / home
# du -ks / export / home
426345 / export / home
List the size of all subdires and files in a certain directory
# du / opt
8 / OPT / SunWebnfs / Jfilechooser-Patch / COM / Sun / Java / Swing / Plaf / WINDO
10 / OPT / SunWebnfs / Jfilechooser-Patch / COM / SUN / JAVA / SWING / PLAF12 / OPT / SUNWEBNFS / JFILECHOOOSER-PATCH / COM / SUN / JAVA / SWING
14 / OPT / SunWebnfs / Jfilechooser-Patch / COM / Sun / Java
16 / OPT / SunWebnfs / Jfilechooser-Patch / COM / Sun
18 / OPT / SunWebnfs / Jfilechooser-Patch / COM
...
============================================================================================================================================================================================================= ======================
2, iostat monitor disk command
The iostat command reports the usage of the disk. Each line in the table represents the activity information of a disk. Common options have these:
Parameter N Specifies the disk in cxtydz format.
# iostat -n 2
TTY C0T0D0 FD0 C0T2D0 CPU
Tin Tout KPS TPS Serv KPS TPS Serv Kps TPS Serv US Sy Wt ID
0 16 476 23 7 0 0 0 0 0 0 2 2 10 86
0 97 170 22 11 0 0 0 0 0 0 0 3 0 97
0 33 24 3 1 0 0 0 0 0 0 0 0 0 100
0 34 12 2 1 0 0 0 0 0 0 0 0 0 100
0 34 0 0 0 0 0 0 0 0 0 0 0 0 100
Parameter X Report Extension Statistics.
# i itat -x
Extended Device Statistics
DEVICE R / S W / S KR / S KW / S WAIT ACTV SVC_T% W% B
DAD0 21.2 1.4 465.4 10.9 0.0 0.1 6.5 0 12
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
Parameter Z This option is new in the Solaris 8 operating environment. It enables those rows that have no disk activity in the sampling interval, which makes the output shorter and highlight those active disks.
# i itat -z 2
TTY DAD0 FD0 SD0 CPU
Tin TOUT KPS TPS Serv KPS TPS Serv KPS TPS Serv US Sy Wt Id0 16 476 23 7 0 0 0 0 0 0 2 2 10 86
0 97 12 1 7 0 0 0 0 0 0 0 0 0 100
The I / O statistics of the parameter P and P reported partitions (per-partition), is useful when the memory switching device is observed.
# iostat -p 2
Tty DAD0 DAD0, A DAD0, B DAD0, C CPU
Tin Tout KPS TPS Serv KPS TPS Serv Kps TPS Serv Kps TPS Serv US Sy Wt ID
0 16 476 23 7 1 0 28 0 0 27 0 0 0 2 2 10 86
0 117 12 1 1 0 0 0 0 0 0 0 0 0 0 0 0 100
Parameter E is useful for finding a disk that generates an error.
# i itat -ne
C0T0D0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Model: ST320011A Revision: 3.19 Serial No: 3HT3XQ9X
Size: 20.02GB <20019879936 BYTES>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
ILLEGAL REQUEST: 0
C0T2D0 Soft Errors: 0 Hard Errors: 2 Transport Errors: 0
Vendor: LG Product: CD-ROM CRD-8483B Revision: 1.02 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
In addition, some I / O performance may also be affected for disk mirroring.
============================================================================================================================================================================================================= ======================
Third, CPU and memory use monitoring
============================================================================================================================================================================================================= ====================== 1, monitor the CPU and memory with VMSTAT, what is the property?
# vmstat 2
Procs Memory Page Disk Faults CPU
R b W Swap Free Re MF PI PO fr de SR 1M 1M 1M 2M in SY CS US Sy ID
0 0 0 5235888 387408 20 135 10 2 1 0 0 0 0 0 0 170 599 286 0 2 98
0 0 0 5192424 506360 2 4 0 0 0 0 0 0 0 0 0 152 67 173 0 0 100
0 0 0 5192424 506360 0 0 0 0 0 0 0 0 0 0 0 149 138 175 0 0 99
0 0 0 5192424 506360 0 0 0 0 0 0 0 0 0 0 0 131 36 146 0 0 100
0 0 0 5192424 506360 0 0 0 0 0 0 0 0 0 0 0 156 45 161 0 0 100
0 0 0 5192424 506360 0 0 0 0 0 0 0 0 0 0 0 157 101 172 0 0 100
VMSTAT:
PROCS:
R -> The number of processes waiting in the run queue
b -> A number of processes waiting for IO
W -> can enter the run queue but replaced process
Memoy
Swap -> Currently available exchange memory (K)
Free -> Free Memory (K)
Pages
RE - "Recycled page
MF - "Non-serious mistakes
Pi - "Enter the number of pages (K)
Po - "" outlet number (k)
FR - "Space Page Number (K)
DE - "Not missed in advance of the page read in advance
SR - "Page scans through clock algorithm
Disk displays a disk operation per second. s represents the SCSI disk, 0 represents the disk number
FAULT shows the number of interrupts per second
IN - "Device Interrupt
SY - "System Interrupt
CY - "CPU Exchange
The CPU represents the use of CPUs
CS - "Time for user processes
SY - "Time for system processes
ID - "CPU idle time
If R is often greater than 4, and the ID is often less than 40, indicating that the load of the CPU is heavy. If Pi, Po is not equal to 0, indicating insufficient memory.
If Disk is often not equal to 0, and the queue in B is greater than 3, indicating that IO performance is not good.
Examples of insufficient CPU capabilities.
# vmstat 15
Procs Memory Page Disk Faults CPU
R b W SWAP Free RE MF PI PO fr de SR M0 M1 M2 M3 in SY CS US Sy ID
45 0 0 2887216 182104 3 707 449 6 455 0 80 2 6 1 0 1531 5797 983 61 30 9
58 0 0 2831312 46408 5 983 582 56 3211 0 492 0 0 0 0 1413 4797 1027 69 31 0
55 0 0 2830944 56064 2 649 656 3 806 0 121 0 0 0 0 1441 4627 989 69 31 0
57 0 0 2827704 48760 4 818 723 6 800 0 121 0 0 1 0 1606 4316 1160 66 34 0
56 0 0 2824712 47512 6 857 604 56 1736 0 261 0 0 1 0 1584 4939 1086 68 32 0
58 0 0 2813400 47056 7 856 673 33 2374 0 355 0 0 0 0 1676 5112 1114 70 30 0
60 1 0 2816712 49464 7 861 720 6 731 0 110 7 0 3 0 2329 6131 1067 64 36 0
58 0 0 2817552 48392 4 585 521 0 996 0 146 0 0 0 0 1357 6724 1059 71 29 0
One column labeled "R" under "Procs" is the number of processes in the process run queue waiting for the CPU. The "ID" column is the CPU idle time. This machine does not have sufficient CPU resources to meet the needs of the process, which can be seen from its CPU time to see in the user space (see "US" column).
This case solution adds more CPUs, or with other related tools to detect more resource costs, the code's code is performed, see if it is optimized.
The "FR" column in VMSTAT does reflect idle and is not used by the page cache. Use the -p option to give more accurate page scheduling behavior details.
In order to determine if there is insufficient memory, it is checked ("SR", that is, the scan rate) and the disk I / O traffic (IOSTAT -P) are exchanged. If a large number of I / O activities are generated by the file system and need to run the page scanner for the I / O release page, the "SR" column will have a relatively large value.
Save the sample how to run properly. This can easily collect and save the monthly performance data to compare, such as Vmstat, MPstat, Iostat.
============================================================================================================================================================================================================= ====================== 2, PRSTAT gives a dynamic annotation of CPU and memory usage
Example:
#PRSTAT-CVM output is very useful.
============================================================================================================================================================================================================= ======================
3, MPSTAT command reports statistics for each processor
The mpstat command reports the statistics of each processor and each line in the table represents the activity of a processor.
# Mpstat 5
CPU Minf MJF Xcal Intr ITHR CSW ICSW Migr SMTX SRW SYSCL USR SYS WT IDL
0 3 19 0 451 327 300 11 0 0 0 322 2 2 10 86
0 1 0 0 405 303 258 3 0 0 0 176 0 0 0 100
0 0 134 0 711 456 559 21 0 0 0 622 9 8 34 49
0 2 28 0 644 434 703 143 0 0 0 1392 28 12 15 45
0 0 23 0 624 412 478 35 0 0 0 941 10 18 14 57
MPSTAT can determine what each CPU is speaking for time: for example, allocated to the system, user, waiting, idle time, system call, lock competition, interrupt, error, cross call.
MPSTAT's "WT" column shows too much waiting time. The user task takes too long. As part of your positive maintenance plan, there is no hardware problem such as disk retry in VAR / ADM / MESSAGES, or there is no extra message generation.
Grand Encyclopedia CPU 100% Case:
The large encyclopedic Sun system often reports the CPU 100%. The highest process of CPU is sometimes some of the zombie process. After killing the CPU, the CPU is immediately dropped, and the following information in / var / adm / messages is as follows:
Mar 3 16:45:15 DBKSVR UNIX: [ID 340762 Kern.notice] from memory module 1901mar 3 16:45:15 dBksvr UNIX: [ID 221138 kern.notice] consider replacing the memory module.mar 3 16:45:15 DBKSVR UNIX: [ID 547813 kern.notice] Multiple SoftRRORS: Mar 3 16:45:15 DBKSVR UNIX: [ID 356634 kern.notice] 256 intermittent, 0 persistent, and 0 sticky SoftRRORS Acumulated question when the hardware memory strip problem, when transaction When the amount is small, the memory does not use this problem. When the amount of transaction is large, the memory is started to use this problem, causing a deadlock, and the CPU is 100%.
============================================================================================================================================================================================================= ======================
4, Proc Tool Report Process Attribute
PROC is a utility that uses / proc to report, for example, such a practical tool for some process properties:
1) PSTACK - Call Stack
2) Pfiles - Open file descriptor list
3) PLDD - List of dynamic link libraries that are running in operation
Example:
#ps -ef
Root 1838 1 0 March 03? 0:00 / usr / sbin / syslogd
Root 1479 1 March 03? 0:01 Ocfserv
...
# pstack 1838
1838: / USR / SBIN / SYSLOGD
---------------- LWP # 1 / thread # 12 --------------------
FF217AC8 Poll (FF03BD0C, 1, FFFFFFF)
FF15B35C Poll (C, FF174780, 1, 2A8C8, 2B164, FE401000) 34
FF15BC08 _thread_start (0, 0, 0, 0, 0, 0) 40
---------------- LWP # 2 / Thread # 2 --------------------
...
# ptree 1838
1933 / USR / DT / BIN / DTLOGIN-DAEMON
6359 / usr / dt / bin / dtlogin -daemon
6380 / bin / ksh / usr / dt / bin / xsession
6390 / usr / openwin / bin / fbconsole
...
# pfiles 1838
1838: / USR / SBIN / SYSLOGD
Current Rlimit: 1024 File Descriptors
0: S_IFCHR Mode: 0600 Dev: 136, 0 ino: 749016 Uid: 0 GID: 3 RDEV: 97, 0
O_wronly | o_append
1: S_IFCHR Mode: 0666 Dev: 136,0 ino: 749009 Uid: 0 GID: 3 RDEV: 13, 2
O_rdonly | o_largefile
...
# PLDD 1838
1838: / USR / SBIN / SYSLOGD
/usr/lib/libnsl.so.1
/usr/lib/libpthread.so.1
/usR/LIB/LIBDOOR.SO.1
/usr/lib/libc.so.1
...
============================================================================================================================================================================================================= ======================
5, PMAP command reports the memory space layout of individual processes
For separate processes, the PMap command reports the memory space layout of the individual process (-x option is relatively useful).
Example:
#ps -ef | GREP HTTPD
ROOT 1158 1 0 March 03? 0:00 / OPT / IBMHTTPD / BIN / HTTPD
Daemon 1064 1063 0 March 03? 0:00 / usr / lib / ab2 / dweb / sunos5
TPD / USR / LIB / AB2 / DWEB / DATA
Nobody 1704 1158 0 March 03? 0:00 / OPT / IBMHTTPD / BIN / HTTPD
Nobody 1705 1158 0 March 03? 0:00 / OPT / IBMHTTPD / BIN / HTTPD
...
#PMAP -X 1710
1710: / OPT / IBMHTTPD / BIN / HTTPD
00010000 584k Read / Exec / OPT / IBMHTPD / BIN / HTTPD
000B0000 40K Read / Write / EXEC / OPT / IBMHTTPD / BIN / HTTPD
000BA000 208K Read / Write / EXEC [HEAP]
FECA0000 24K Read / Exec /usR/LIB/NSS_FILES.SO.1
FECB6000 8K Read / Write / EXEC /USR/LIB/NSS_FILES.SO.1
FECC0000 368k Read / Write / Shared [Anon]
Fed20000 136k Read / Exec /opt/websphere/appserver/bin/libascommonmon.so
...
============================================================================================================================================================================================================= ====================== 6, using the PS command to get the memory, CPU utilization status and sort
The PS command displays the relevant data that is running a process, using the PS command to obtain the memory of the process, and the CPU utilization status. Use these commands to see the process using CPU and memory:
1) # ps -eo pid, pcpu, args | sort 1n
CPU percentage
2) # ps-eo pid, vsz, args | sort 1n
K byte virtual memory
3) # / usr / ucb / ps -aux | more
# / usr / ucb / ps -aux | Head
The output is sorted, and the process of the most CPU and the most memory is placed above.
Note: Two different tools when / usr / bin / ps and / usr / ucb / ps.
/ USR / UCB / PS, the STAT column shows the status of each process:
R process can run
s sleep, not interrupt
S sleep
I idle
T stop
H hangs
W is switchable to disk
? The process exceeds the soft limit of memory
Process leader with a control terminal
The n process runs in the case of a decrease in priority.
============================================================================================================================================================================================================= ====================== 7, uptime and w command View the load situation of the system in the past 15 minutes Uptime can run a very long time running how long it runs, and the load of the system in the past 15 minutes. W Command (Who is in the system) and uPtime, the first line gives the UPTime information, and the user information is given. Example: # uptime Run 7 days and 16 minutes in 2:54 pm 7 USERS, average load: 0.02, 0.06, 0.06 # w Run 7 days and 16 minutes in 2:54 pm 7 USERS, average load: 0.02, 0.06, 0.06 Username terminal number login time idle JCPU PCPU execution command Root Console Friday 10:3am 3:11 27 / USR / DT / BIN / DTEXEC ROOT PTS / 11 Friday 11:3am - SHROOT PTS / 13 Friday 11:3am - SH Root PTS / 15 1 PM 1:07 Telnet 162.105.183.8 Root PTS / 12 Tuesday, 11:3:00 on TCSH ============================================================================================================================================================================================================= ====================== 8, use TOP tool monitoring performance TOP is a third-party software that requires additional installation, and the TOP installation version of Solaris 8 is under SUNSERVER1 / SOFTWARE. TOP lists 15 processes that consume the Upper CPU and constantly update. 1) TOP commands There are several parameter options, only describe the following, other reference documents: I does not show idle processes D count Update Result Coun exits, default unlimited, CTL C or CTL D exit D TIME two consecutive refresh time intervals, default 5 seconds U Username only shows the process belonging to user username Example: # TOP Lists 15 all processes that consume up to CPU # Top -i Last PID: 8671; Load Averages: 0.02, 0.02, 0.03 17: 28: 1 112 Processes: 108 Sleeping, 2 Zombie, 1 Stopped, 1 on CPU CPU States: 99.8% iDLE, 0.0% User, 0.2% Kernel, 0.0% iowait, 0.0% SWAP Memory: 512M Real, 162M Free, 274M SWAP in Use, 599M Swap Free Pid Username THR PRI Nice Size Res State Time CPU Command 8671 Root 1 59 0 2624K 1656K CPU 0:00 0.27% Top 6358 root 1 59 0 30M 21M SLEEP 7:42 0.03% XSUN 8670 Oracle 1 59 0 105M 80M SLEEP 0:00 0.03% Oracle 8669 Oracle 4 59 0 9536k 5496k Sleep 0:00 0.02% SQLPLUS 1270 Root 13 58 0 39M 17M Sleep 2:04 0.02% Java # Top -u Oracle Last Pid: 8673; Load Averages: 0.02, 0.02, 0.03 17: 29: 40112 Processes: 108 Sleeping, 2 Zombie, 1 Stopped, 1 On CPU CPU States: 99.8% iDLE, 0.0% User, 0.2% Kernel, 0.0% iowait, 0.0% SWAP Memory: 512M Real, 162M Free, 274M SWAP in Use, 599M Swap Free Pid Username THR PRI Nice Size Res State Time CPU Command 2294 Oracle 1 48 0 105M 78M SLEEP 0:09 0.00% Oracle 2306 Oracle 1 52 0 12M 6664K Sleep 0:07 0.00% TNSLSNR 2292 Oracle 11 59 0 107M 76M Sleep 0:06 0.00% Oracle 8425 Oracle 11 58 0 108M 84M SLEEP 0:01 0.00% Oracle 2288 Oracle 29 59 0 108M 77M SLEEP 0:01 0.00% Oracle ... Only listing Oracle users 2) Use interactive commands with TOP D changes the number of display, if you start using the top -d command, press D to change the number of display N changes the number of processes displayed S changes the time interval of refreshing K killed the specified PID I or I switching to display the idle process ============================================================================================================================================================================================================= ====================== 9, how to increase the switch space Unable to change the partition size after the system is installed, but can increase / delete the exchange file, which effect is similar to the partition. The following command creates a 500MB swap file in the root directory, named swapfile # MKFILE 500M / SWAPFILE Make it effective # swap -a / swapfile Now you have extra 500MB swap space, in order to be effective, edit / etc / vfstab file after each restart, increase the following / swapfile - - swap - no - # swap -l Here "-l" means "List", which shows all swap spaces. Read the "SWAP" and "MKFile" man page carefully. ============================================================================================================================================================================================================= ====================== 4, check network performance tools ============================================================================================================================================================================================================= ====================== 1, Snoop Diagnostics Network Packet Tool Snoop captures and display network packets issued by diagnostic network issues Example: # snoop # snoop -r | grep 162.105.183.49 This command locks all the web packets transferred from an IP, can capture input and echo, even password, horrible :) ============================================================================================================================================================================================================= ====================== 2, NFSSTAT monitoring NFS system NFSSTAT shows NFS statistics for clients and servers, including timeout, retransmission, waiting errors, and information about cache hits and failure. It can be determined whether it is NFS to decrease network performance. Example: # nfsstat | more See NFSSTAT's help documentation and parameters. ============================================================================================================================================================================================================= ======================= 3, NetStat monitoring network interface 1) # netstat -a Display statistics about Internet protocol socket status 2) # Netstat -i 2 Show statistics on the network interface, this command is important. 2 For interval time parameters, adjustable. # netstat -i 2 Input Lo0: 1 Output Input (Total) Output Packets Errs Packets Errs Colls Packets Errs Packets Errs COLLS 0 0 0 0 0 3505609 0 3263609 1 35792 0 0 0 0 0 8 0 5 0 0 0 0 0 0 0 18 0 12 0 0 3) # netstat -n By default NetStat resolves the address as host name, use n option, cancel parsing Using IP Address 4) # netstat -r Show the routing table of the host # netstat -r Routing Table: IPv4 Destination Gateway Flags Ref Use Interface ----------------------------------- ------ --------- ClusterNode2-Priv Clusternode2-Priv UGH 1 0 172.16.194.4 ClusterNode1-Priv U 1 8 QFE2: 2 172.16.0.128 172.16.0.129 u 1 8 QFE2 172.16.1.0 172.16.1.1 U 1 8 QFE0 162.105.183.0 SunServer1 u 1 24 ERI0 162.105.183.0 SunServer U 1 0 Eri0: 1 172.16.193.0 Localhost U 1 0 LO0 224.0.0.0 SunServer1 u 1 0 ERI0 Default 162.105.183.1 UG 1 10 Localhost Localhost UH 1 0 LO05) # NetStat -s Displays statistics for each protocol. 6) # netstat -s -p TCP Statistics of Chaoskin TCP Agreement 7) # netstat -na -p tcp What ports are open ============================================================================================================================================================================================================= ====================== 4. How do you know which process uses which port under Solaris? NetStat -NA -P TCP is open, but it does not report which process is opened. Attachment PS9000 scripts can list which process for each open port. ROOT identity can view all processes, and other identities can view this user's process. ============================================================================================================================================================================================================= ====================== 5, ping diagnostic network connection and blocking problem 1) ping ip Example: # ping 162.105.183.15 162.105.183.15 is alive 2) ping -s [ip] has been ping an address, press CTL C or D termination, similar to the -t option under Win Example: # ping -s 162.105.183.8 3) PING -P [port] [ip] checks a port Example: # ping -p 7001 162.105.183.12 162.105.183.12 is alive # ping 9001 162.105.183.12 Ping: Bad Timeout: 162.105.183.12 4) ping -a ip Example: # ping -a 162.105.183.49 162.105.183.49 (162.105.183.49) IS alive ============================================================================================================================================================================================================= ====================== 6, IPCS displays statistics related to internal process communication Example: # ipcs IPC Status from T iD key mode Owner Group Message Queues: Q 0 0x2e781d5 - rw-r - r - Root root Q 1 0x2e781d2 -r --- w - w- root root Shared memory: M 0 0x50000E7E --RW-R - R - Root root M 201 0x4C0002D0 --RW-RW-R - Lanman Sys M 2 0xD961604C --RW-r ----- Oracle OinsTall Semaphores: S 196608 0xbaa9a0cc --ra-r ----- Oracle OinsTall S 1 0xBAA9A0CD --RA-R ----- Oracle OinsTall S 2 0xbaa9a0ce - RA-R ----- Oracle OinsTall ============================================================================================================================================================================================================= ====================== 7. Traceroute displays a message to the destination owner, used to diagnose network congestion Traceroute IP Example: # Traceroute www.pku.edu.cn Traceroute to rock.pku.edu.cn (162.105.129.12), 30 hops max, 40 Byte Packets 1 162.105.183.1 (162.105.183.1) 0.916 ms 0.772 ms 0.705 ms 2 162.105.170.1 (162.105.170.1) 1.262 ms 1.144 ms 1.131 ms 3 162.105.162.126 (162.105.162.126) 1.934 ms 1.304 ms 1.135 ms4 * * * 5 * * * ============================================================================================================================================================================================================= ====================== 8, Route Get IP Get the gateway passed by # Route Get www.sina.com.cn Route to: sina37-34.sina.com.cn Destination: Default Mask: Default GATEWAY: 162.105.183.1 Interface: HME0 Flags: Recvpipe Sendpipe Ssthresh RTT, MS RTTVAR, MS Hopcount MTU Expire 0 0 0 0 0 0 1500 0 Li Shouliang SLLI@founder.com.cn 2003-03-10