Network monitor
- C++ 93.1%
- Makefile 6.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| .gitignore | ||
| Makefile | ||
| README.md | ||
netmon
A terminal network speed monitor for Linux and macOS. Shows live download/upload throughput as a scrolling graph, viewable over several timeframes.
netmon iface: wlan0 (1/3) window: 5m down: 1.2 MB/s up: 84 KB/s
Download peak 3.4 MB/s avg 980 KB/s
3.9 MB/s
▁▂▃▅▆▇████▇▆▅▄▃▂▁▂▃▅▇█
0
Upload peak 210 KB/s avg 76 KB/s
240 KB/s
▁▂▃▃▄▄▃▂▁▁▂▃▄▄▃▂▁
0
-5m now
[1]60s [2]5m [3]15m [4]1h [5]6h [6]24h
n: next iface p: prev iface q: quit
Features
- Live download/upload graphs, sampled once per second from the kernel's
per-interface byte counters (
/proc/net/devon Linux,sysctl(NET_RT_IFLIST2)on macOS) - Switch between six timeframes (60s, 5m, 15m, 1h, 6h, 24h) without losing history — up to 24h of per-second samples are kept per interface
- Cycle through all detected network interfaces
- Auto-scaling y-axis, peak/average stats for the visible window
Requirements
- Linux or macOS
- A C++17 compiler (g++ or clang++)
- ncurses development headers — the wide-character build (
ncursesw) where one exists; macOS's system libncurses is already wide-capable
On Debian/Ubuntu:
sudo apt install build-essential libncursesw5-dev
On macOS, the Command Line Tools are enough (xcode-select --install).
Homebrew's ncurses is used automatically if installed.
Build
make
This produces a netmon binary in the project root.
Run
./netmon # auto-selects the first active non-loopback interface
./netmon wlan0 # start on a specific interface
Keybindings
| Key | Action |
|---|---|
1–6 |
Select timeframe (60s/5m/15m/1h/6h/24h) |
n / Right |
Next interface |
p / Left |
Previous interface |
q |
Quit |
Project layout
src/main.cpp - ncurses UI, input handling, sampling loop
src/netstat.h/.cpp - per-interface byte counters (Linux + macOS backends)
src/model.h - per-interface history ring buffer, downsampling, formatting
Makefile
Disclaimer
This project was written with the assistance of AI. The code and documentation were largely AI-generated and then reviewed by a human. Review it yourself before relying on it for anything important.