2 Star 11 Fork 1

Davin / TMD-TOP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
en-README.md 4.66 KB
一键复制 编辑 原始数据 按行查看 历史
CDWEN 提交于 2024-03-07 14:16 . Revert "更新文档"
logo

🌈Introduction

|🌐[ 中文说明 ] |🌐 [ English Introduction ] |

😈TMD🖕TOP is a network traffic monitoring tool dedicated to Linux terminals. It can display the number of IP connections between the server and each client, upload and download speeds, and bandwidth usage in real time. It deeply analyzes the impact of various services and scripts on network resources, helping operation and maintenance personnel to quickly identify and optimize high-bandwidth-consuming services to ensure efficient and stable system performance. With its concise and easy-to-read table view and flexible filtering function, TMD-TOP is an ideal assistant for administrators in network management and performance tuning.

Easily order a star. ⭐

1708502942300

🌈Version requirements

👊Notice

python >= 3.8

🌈Environmental requirements

Install pidstat command (apt install sysstat)
Install netstat command (apt install net-tools)

🌈Installation tutorial

sudo pip install tmd-top

🌈Update

sudo pip install --upgrade tmd-top

🌈Instructions for use

Execute the tmd-top command on the terminal

root@davin-system:~/tmd-top# tmd-top

or

root@davin-system:~/tmd-top# /usr/local/bin/tmd-top

or(Under home directory .local/bin)

root@davin-system:~/tmd-top# ~/.local/bin/tmd-top

<<<<<<< HEAD

=======

d3bb76958231453c9fc5e28ae3b9a1816f4dfe3a 👊Note: only services with traffic activities are displayed.

🌈shortcut command

shortcut command

1708502426439

"q"---quit    #quit
'v'---InputPID		#Enter pid to query
't'---LowSpeedRefresh		#Refresh data slowly
'y'---RestoreRefresh		#Restore refresh data speed
'c'---ConnectionNumberSort	#Sort by number of connections
'i'---IpNumberSort		#IP number sorting
'u'---UploadSort			#Upload sorting
'd'---DownloadSort 		#Download sorting
'z'---CpuSort				#cpu sort
'x'---MemorySort			#Memory Sort
'n'---IoReadSort			#Io Read Sort
'm'---IoWriteSort			#Io Write Sort

🌈IP identification

Data source: IP identification is implemented using geoip. The current update time of geoip is: 2024-02-16

Chinese display area: Change the language of the operating system to zh_CN, and use the locale command to view the system language.

🌈Data display chart

Server monitors traffic

1708502144748

Traffic generated by server running programs

1708502212499

Server network card traffic

1708502247441

Detailed client traffic

1708502358692

🌈creative ideas

​ As a Linux operation and maintenance personnel, I find that the traffic view function of FinalShell is extremely efficient and practical when troubleshooting network problems. Although I have tried tools such as iftop and nload, their ease of use and visualization are not as good as FinalShell. Therefore, in view of my reliance on FinalShell's traffic monitoring function, I decided to learn from its design ideas and develop an intuitive and accurate network traffic monitoring tool to meet my work needs.

🌈Software Architecture

  1. Here is the list text data collection module: execute Linux underlying commands (such as netstat) through Python's subprocess or os library to obtain the status information of the server's internal TCP connection in real time. This information includes but is not limited to client IP, port, connection status, transmission rate and other key indicators.

  2. Here is the list text database storage module: Use SQLite as a local persistent storage solution to write the collected TCP connection data into a database table in a structured form. This module is responsible for creating and managing database connections, as well as performing SQL insert operations.

  3. Data processing module: Preprocess and format the original data, such as converting it into a format suitable for storage in SQLite, and may further perform data analysis to calculate advanced statistical indicators such as upload and download speeds per second, number of concurrent connections, etc. .

  4. User interface display module: build a terminal interface based on the textual library and dynamically display TCP connection statistics read from the database.

Ask the author for a cup of coffee

If this project was helpful to you and helped you solve your problem, you can buy the author a cup of coffee! ! !

输入图片说明

Python
1
https://gitee.com/Davin168/tmd-top.git
git@gitee.com:Davin168/tmd-top.git
Davin168
tmd-top
TMD-TOP
master

搜索帮助