This article contains 1329 words and takes about 3 minutes to read!
We mentioned
This article mainly records the Linux system on some common system monitoring tools, very easy to use. It is worth taking some time to summarize what is called sharpening the knife and cutting wood.
Welcome to My Personal Blog
The brain map of this paper is as follows:
The top command
Top command I think you are familiar with it! The top command in Linux is similar to the Task manager in Windows. It can dynamically monitor and display the resource usage of each process in the system in real time. It is a commonly used performance monitoring and analysis tool in Linux.
A common execution view of the top command is as follows:
Below we mark the meaning of each indicator in detail in the diagram, carefully look at the diagram for comparison and understanding (if necessary, you can save the diagram for future reference) :
How, understand enough intuitive bar, as for the top command with some other parameters to use their own help bar, too much, no longer repeat!
Htop command
Htop is the next interactive Linux process browser, which can completely replace the top command described in the previous section. Compared with the top command, htop command has the following advantages:
- Direct support for mouse click operation (ask you 6 not 6!)
- The screen can scroll horizontally and vertically, more like a window
- You can trace the process and display the files opened by the process
- Support tree display of processes
- Supports process search by name
Anyway, visualization is 66, let’s try it out:
For this diagram, it is divided into three parts:
- At the top is an overview of resource usage, a progress bar that looks pretty cool
- In the middle is the process table, similar to the top command
- The following instructions and shortcuts are clear
Let’s look at some graphical operations:
- Process tree
- Mouse click on a variety of indicators to sort
- Trace process function
Iotop command
Iotop monitors disk I/O usage. The UI is similar to TOP, including PID, user, I/O, and process information.
Most of the IO statistics tools such as iostat and nmon in Linux can only measure the read and write status of per devices. If you want to know how each process uses I/O, you can run the iotop command to view the information conveniently.
Iftop command
Iftop is a traffic and bandwidth monitoring tool for Linux systems. It can be used to view real-time network traffic, monitor TCP/IP connections, etc. It is also very useful!
Let’s do an experiment. After executing the command, the result is as follows:
The common parameters of the iftop command are as follows. Here is a summary:
-i
Set up the monitoring network card, for example:# iftop -i eth1
-B
Displays traffic in bytes (bits by default), for example:# iftop -B
-n
Make the host information directly display IP by default, for example:# iftop -n
-N
Make the port information directly display the port number by default, for example:# iftop -N
-F
Displays incoming and outgoing traffic on a specific network segment, for example# iftop - F 10.10.1.0/24
或# iftop -F 10.10.1.0/255.255.255.0
-h
(display this message), help, display parameter information-p
When this parameter is used, the middle list displays localhost information, with IP information other than the local host.-b
Make the traffic graph bar display by default;
To summarize, some operation commands after entering the iftop view screen (case sensitive) :
- According to the
h
Switch whether to display help; - According to the
n
Switch to display the IP address or host name of the host; - According to the
s
Switch whether to display the host information of the host. - According to the
d
Switch whether to display the host information of the remote target host. - According to the
t
Switch the display format to 2 lines /1 line/display only the sent traffic/display only the received traffic. - According to the
N
Switch display port number or port service name; - According to the
S
Switch whether to display the port information of the host. - According to the
D
Switch whether to display the port information of the remote target host. - According to the
p
Switch whether to display port information. - According to the
P
Switch pause/continue display; - According to the
b
Switch whether to display the graph bar of average traffic; - According to the
T
Switch whether to display the total traffic of each connection; - According to the
l
Enable the screen filtering function. Enter a character to be filtered, such as IP address, and press Enter. Only traffic information related to this IP address is displayed on the screen. - According to the
L
Switch the scale above the display screen; The scale is different, the flow graph bar will change; - According to the
j
Or byk
You can scroll up or down the connection record displayed on the screen; - According to the
1
or2
or3
You can sort traffic data according to the three columns displayed on the right. - According to the
<
Sort by native name or IP on the left; - According to the
>
Sort by the host name or IP address of the remote destination host. - According to the
o
Toggle whether only the current connection is displayed.
Remember after
Due to the limited ability, if there is a mistake or improper place, please also criticize and correct, study together!
- My Personal Blog: CodeSheep program sheep
- My six months of tech blogging
To subscribe to CodeSheep’s public account, long press or scan below, you can get more practical, understandable and reproducible original articles