Skip to main content

linux服务器流量分析工具

Project description

logo

🌈 介绍

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

😈TMD🖕TOP 是一款Linux终端专用的网络流量监控工具,能实时展示服务器与各客户端IP连接数、上传下载速度及带宽使用情况。它深度分析各类服务和脚本对网络资源的影响,帮助运维人员快速识别并优化高带宽消耗的服务,以确保系统性能高效稳定。凭借简洁易读的表格视图和灵活筛选功能,TMD-TOP是管理员进行网络管理与性能调优的理想助手。

顺手点个star⭐

1708502942300

🌈 版本要求

👊注意:

python >= 3.8

🌈 环境要求

安装pidstat命令(apt install sysstat)
安装netstat命令(apt install net-tools)

🌈 安装教程

sudo pip install tmd-top

🌈更新

sudo pip install --upgrade tmd-top

🌈 使用说明

在终端上执行运行tmd-top命令

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

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

或(家目录.local/bin下)

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

👊注意: 只展示有流量活动的服务

🌈 快捷指令

快捷指令

1708502426439

"q"---quit    #退出
'v'---InputPID		#输入pid进行查询
't'---LowSpeedRefresh		#慢速刷新数据
'y'---RestoreRefresh		#恢复刷新数据速度
'c'---ConnectionNumberSort	#连接数排序
'i'---IpNumberSort		#ip数量排序
'u'---UploadSort			#上传排序
'd'---DownloadSort 		#下载排序
'z'---CpuSort				#cpu排序
'x'---MemorySort			#内存排序
'n'---IoReadSort			#io读排序
'm'---IoWriteSort			#io写排序

🌈 IP识别

数据来源: ip识别是使用geoip来实现的,目前geoip的更新时间是: ⌚️ 2024-02-16

中文显示地区: 将操作系统的语言改成zh_CN,locale命令查看系统语言。

🌈 数据展示图

服务器监听流量

1708660148602

服务器运行程序产生的流量

1708660204271

服务器网卡流量

1708502247441

详细客户端流量

1708502358692

🌈 创作想法

作为一名Linux运维人员,我发现FinalShell的流量视图功能在排查网络问题时极为高效实用。尽管尝试过iftop和nload等工具,但其易用性和可视化效果均不及FinalShell。因此,鉴于对FinalShell流量监控功能的依赖,我决定借鉴其设计思路,自行开发一款直观精确的网络流量监控工具以满足工作需求。

🌈 软件架构

  1. 这里是列表文本数据收集模块:通过Python的subprocess或os库执行Linux底层命令(如netstat),实时获取服务器内部TCP连接的状态信息。这些信息包括但不限于客户端IP、端口、连接状态、传输速率等关键指标。

  2. 这里是列表文本数据库存储模块:利用SQLite作为本地持久化存储解决方案,将收集到的TCP连接数据以结构化形式写入数据库表中。此模块负责创建和管理数据库连接,以及执行SQL插入操作。

  3. 数据处理模块:对原始数据进行预处理和格式化,例如转换为适合存储在SQLite中的格式,并可能进一步进行数据分析,计算出如每秒上传下载速度、并发连接数等高级统计指标。

  4. 用户界面展示模块:基于textual库构建终端界面,动态显示从数据库中读取的TCP连接统计数据。该

请作者喝杯咖啡

如果该项目对你有帮助,帮您解决了问题,可以请作者喝杯咖啡!!!

输入图片说明

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tmd_top-2.0.8-py3-none-any.whl (31.0 MB view details)

Uploaded Python 3

File details

Details for the file tmd_top-2.0.8-py3-none-any.whl.

File metadata

  • Download URL: tmd_top-2.0.8-py3-none-any.whl
  • Upload date:
  • Size: 31.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for tmd_top-2.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3b1fc50c0bc1c47161cbf26e989062341d3c13f255971847b6a22ae6d7499093
MD5 7eb035f97d4230f7f68ee7ca1bf8cfad
BLAKE2b-256 016d130695cf33d206cf85395d851f283d91da3282db5e5c3f29e8a3ae449143

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page