Netstat
The Netstat command is used to display various network-related information, such as network connections, routing tables, Interface states (Interface Statistics), masquerade connections, multicast members (multicast memberships), and so on.
Active Internet connections (w/o servers)
Proto recv-q send-q Local address Foreign address state
TCP 0 2 210.34.6 .89:telnet 210.34.6.96:2873 established
TCP 296 0 210.34.6.89:1165 210.34.6.84:netbios-ssn ESTABLISHED
TCP 0 0 LOCALHOST.LOCALDOM:9001 localhost.localdom:1162 established
TCP 0 0 localhost.localdom:1162 Localhost.localdom : 9001 established
TCP 0 210.34.6.89:1161 210.34.6.10:netbios-ssn close
Active UNIX domain sockets (w/o servers
Proto refcnt Flags Type State i-node Path
UNIX 1 [] stream CONNECTED 16178 @000000dd
Unix 1 [] stream CON nected 16176 @000000dc
Unix 9 [] dgram 5292/dev/log
UNIX 1 [] STREAM CONNECTED 16182 @000000df
As a whole, the output of Netstat can be divided into two parts:
One is the active Internet connections, known as the active TCP connection, where "recv-q" and "Send-q" refer to%0a receive queues and send queues. These numbers should generally be 0. If not, it means that the package is piling up in the queue. This situation can only be seen in very few situations.
The other is active UNIX domain sockets, known as the active UNIX domains socket (like a network socket, but only for native communication, which can improve performance by a factor).
Proto displays the protocol used by the connection, refcnt represents the process number that is attached to this set of interfaces, types displays the type of the socket interface, state displays the current status of the socket interface, and path represents the pathname used by other processes connected to the socket interface.
-A (all) shows all options, default does not show listen related
-T (TCP) displays only TCP-related options
-U (UDP) only displays UDP-related options
-N denies displaying aliases, and can display all numbers converted to numbers.
-l list only service status with Listen (listening)
-P Displays the name of the program that establishes the associated link
-R Displays routing information, routing table
-e display extended information, such as UID, etc.
-S statistics according to each protocol
-C executes the netstat command at every other fixed time.
Hint: The status of listen and listening can only be seen with-a or-l
tcpdump
The simplest way to define tcpdump is: Dump the traffic on a network, the packet analysis tool that intercepts packets on the network according to the user's definition. Tcpdump can intercept the "head" of packets transmitted in the network and provide analysis. It supports filtering for network layers, protocols, hosts, networks, or ports, and provides logical statements such as and, or, not to help you get rid of useless information.
default startup
Tcpdump
Under normal circumstances, direct start tcpdump will monitor all packets flowing through the first network interface.
monitoring packets for a specified network interface
Tcpdump-i eth1
If you do not specify a network adapter, the default tcpdump only monitors the first network interface, typically eth0, and the following examples do not specify a network interface.
monitor packets for the specified host and port
If you want to obtain a telnet package that the host 210.27.48.1 receives or emits, use the following command
Tcpdump TCP port and host 210.27.48.1
Monitoring the UDP 123 port on this machine 123 is the service port for NTP
IPCS and Ipcrm
obtain IPC information:
IPCS [-m|-q|-s]
-m outputs information about shared memory (shared memory)
-Q Output Information about the information queue (message queue)
-S output information about the semaphore
# ipcs-m
IPC status from <running system> as of April 10, 2007 Tuesday 18:32 18 sec CST
T ID KEY MODE OWNER GROUP
Shared Memory:
M 0 0x50000d43--rw-r--r--root root
M 501 0x1e90c97c--rw-r-----Oracle DBA
#ipcs |grep Oracle|awk ' {print $}
501
Remove IPC (clear shared memory information)
Ipcrm-m|-q|-s shm_id
%IPCRM-M 501
For i in ' ipcs |grep oracle|awk ' {print $} '
do
ipcrm-m $i
ipcrm-s $i
Done
Ps-ef|egr EP "Ora_|asm_" |grep-v grep |grep-v Crs|awk ' {print $} ' |xargs kill-9