@foresite/netrack
v0.1.1
Published
Per-process network usage tracker with a desktop widget. Linux-only; requires Docker.
Downloads
34
Maintainers
Readme
netrack
Per-process network usage tracker for Linux, with a desktop widget. Shows which app/process used how much bandwidth, going forward.
netrack today cumulative per-process totals (KB / MB / GB)
netrack watch live terminal dashboard
netrack widget on-screen desktop widgetPlatform & prerequisites
- Linux only. Per-process tracking reads
/proc/<pid>/fdto map sockets to processes — a Linux-kernel capability that macOS/Windows do not expose the same way. macOS/Windows are unsupported for per-process tracking. - Docker (with your user in the
dockergroup), or sudo. This is how it reads host process tables without root. The install script checks for it and explains how to set it up.
No nethogs binary is bundled. A container image containing nethogs is built from Alpine's packages on first use (see NOTICE for the GPL attribution).
Install
npm install -g @foresite/netracknetrack start builds the container image on first run (one time), then the
sampler begins tracking.
Usage
netrack # overview: sampler + widget + durability
netrack start # start the background sampler
netrack stop # stop the sampler (totals retained)
netrack status # sampler state + last sample time
netrack today # cumulative per-process totals
netrack top [N] # most active processes right now
netrack watch [N] # live dashboard (Ctrl-C to quit)
netrack reset # zero the accumulated totals
# widget
netrack widget start # show the desktop widget
netrack widget stop # hide it
netrack widget status
The widget can be closed with a right-click (or dragged around with the left
button).
# durability — OFF by default (ephemeral)
netrack autostart on # start sampler at boot + widget at login
netrack autostart off
netrack autostart statusBy default netrack is ephemeral: it doesn't start on boot. Enable
persistence with netrack autostart on (creates a @reboot cron entry for
the sampler and a GNOME autostart entry for the widget). Disable anytime with
netrack autostart off.
Entries whose process has exited are pruned from the totals on the next
sample, so usage.txt stays small and netrack today always reflects
currently-active processes.
Configuration
Config file: ~/.config/netrack/config. Values are KEY=VALUE; environment
variables override file values.
| Key | Default | Purpose |
|----------------|--------------|-------------------------------------------|
| NETRACK_IF | wlo1 | Network interface to track |
| AUTOSTART | 0 | Boot durability on/off |
| WIDGET_CORNER| top-right | Widget default corner when not dragged |
Uninstall
netrack autostart off # remove any cron/autostart entries
netrack stop
npm uninstall -g netrack
docker rmi netrack:latest # optionally drop the container imageLicense
MIT (this project) — see LICENSE. Bundled runtime dependency nethogs is GPL-2.0-or-later; see NOTICE.
