Skip to main content

轻量级 Linux 终端网络流量监控工具

Project description

netop logo


netop

中文说明

netop is a focused rewrite of the original tmd-top idea for day-to-day Linux network troubleshooting. The upstream project has not seen active feature work for a while, and its original design bundled GeoIP lookup, SQLite snapshot tables, firewall mutation, and TUI rendering into one application. This fork intentionally narrows the scope to one job: fast, read-only terminal network monitoring.

netop terminal UI

Design Goals

  • Pure monitoring: no IP ban button, no iptables, nftables, or firewalld writes.
  • Stateless runtime: no SQLite database and no persistent traffic history.
  • No GeoIP: no bundled MMDB file, no location column, no per-IP lookup cost.
  • Low overhead: collect from ss, ps, and /proc/net/dev, then calculate rates from in-memory deltas.
  • Modern Textual path: use public Textual APIs and track textual>=8.2,<9 instead of pinning to textual==1.0.0.

Current Status

This is an early refactor branch. The package and CLI entry point have been renamed to netop. Compatibility with the old tmd and tmd-top command names is intentionally not preserved.

The UI currently shows:

  • interface traffic
  • listening services
  • outbound processes
  • per-service or per-process TCP connection details
  • search, refresh mode, sort mode, permission state, and rate unit state

Requirements

  • Python >= 3.10
  • Linux
  • iproute2 for ss
  • procps for ps

Install

The recommended installation path is PyPI:

python -m pip install netop

If your default pip index is an internal mirror that has not synced netop yet, install from the official PyPI index:

python -m pip install --index-url https://pypi.org/simple netop

For local development, install from source:

python -m pip install -e .

Usage

If netop was installed in a user environment, run it directly:

netop

In normal-user mode, netop will still try sudo -n ss when passwordless sudo is available, so it can display more PID/process ownership data without prompting for a password inside the TUI.

If netop is installed in a root-visible environment, or you need the most complete socket ownership data, run:

sudo netop

Shortcuts

Key Action
q Quit
v Focus search
b Toggle bit/byte rate mode
t Slow refresh to 5 seconds
y Restore refresh to 1 second
r Sort by total traffic
c Sort by connections
i Sort by unique IP count
u Sort by upload
d Sort by download
z Sort by CPU
x Sort by memory

Click or highlight a listening service or outbound process row to display its connection details on the right.

Display Units

By default, netop displays network rates as bit rates such as Kb/s and Mb/s. Press b to switch to byte-rate mode such as KB/s and MB/s.

Data Flow

  1. ss -tniH state established reads TCP socket counters.
  2. ss -tpanH reads listening sockets, established sockets, PIDs, and process names when available.
  3. ps provides lightweight CPU and memory metadata by PID.
  4. /proc/net/dev provides interface-level counters.
  5. The collector computes deltas in memory and sends immutable snapshots to the Textual UI.

What Changed From tmd-top

Area netop direction
GeoIP Removed
SQLite Removed
Firewall ban actions Removed
Package name netop
CLI command netop only
Textual dependency textual>=8.2,<9
Runtime model Read-only, in-memory snapshots

Original Project

Original repository README: https://github.com/CDWEN0526/tmd-top

Project details


Download files

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

Source Distribution

netop-0.1.2.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

netop-0.1.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file netop-0.1.2.tar.gz.

File metadata

  • Download URL: netop-0.1.2.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netop-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e13b41f7c3c5a803de2799ced3155f9f4124c7a1821cc01e2c38f62a52b7b787
MD5 779200166d428c1c66ee8aeb39c123c7
BLAKE2b-256 5143708c82bf18e6b34a4416e0fe879d0630e29e7d039c6b80b0b81742988a5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for netop-0.1.2.tar.gz:

Publisher: pypi.yml on i-square/netop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netop-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: netop-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netop-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b956f197337de5458b52e19cba552b4fa0d360aef8684aa4065f390d0aecd34a
MD5 0776c8ac56f1f1601cb4cb0bf2e40f0f
BLAKE2b-256 3d5d315d0629fd6fb7a6f84ab73e8405a1bf65cc6b0b2720eea8b4e41de7de81

See more details on using hashes here.

Provenance

The following attestation bundles were made for netop-0.1.2-py3-none-any.whl:

Publisher: pypi.yml on i-square/netop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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