A lightweight, real-time Linux system monitor built in modern C++17 with zero external runtime dependencies (except ncurses).
Built for accurate metrics, stable process behavior, and clean terminal UX .
What to notice in the demo:
- Selection sticks to the same PID even while sorting changes
- CPU usage updates smoothly using delta sampling (no spikes/jumps)
- Clean window layout with stable rendering (minimal flicker)
β If you find this useful, consider starring the repo
- Stable process tracking β selection follows the same PID even during live sorting and updates
- Accurate CPU measurement β delta-based calculation avoids misleading spikes
- Correct disk usage β matches real system availability (
df -hbehavior) - Clean, predictable layout β structured ncurses UI for readability
- Direct kernel data access β reads from
/procandstatvfs, no shell utilities
Summary: SysMon is built for correctness, stability, and clarity, not just displaying stats.
SysMon is a terminal-based system monitor built from scratch in C++17. It reads directly from Linux kernel interfaces instead of relying on external tools like top, ps, or df.
Focus areas:
/procparsing- CPU delta sampling
- Memory correctness using
MemAvailable - Disk accounting using
statvfs - Real-time UI rendering with ncurses
- CPU usage (user, system, idle, iowait, IRQ)
- Memory usage using accurate availability model
- Disk usage aligned with
df -h - System uptime
- Network I/O per interface
- Full process list (PID, CPU%, memory, state)
- Sorting (CPU / Memory / PID)
- Scrollable navigation
- Kill process support (
K) - Kernel thread filtering
- PID-stable selection across re-sorts
- Window-based layout
- Color-coded usage bars
- Pause-on-scroll behavior
- Help overlay (
H) - Terminal resize handling
- Refresh interval: 1s
- CPU usage: ~3β5% (idle system)
- Memory usage: ~5β6 MB
- Consistent real-time updates with low overhead
- Direct kernel reads (
/proc,statvfs), no subprocess calls
cpu_usage% = (1 - idle_delta / total_delta) * 100
used = MemTotal - MemAvailable
used = (f_blocks - f_bfree) * f_frsize
free = f_bavail * f_frsize
process_cpu% = (proc_delta / total_cpu_delta) * 100
- C++17 compiler
- CMake
- ncurses
git clone https://github.com/riteshdhurwey/SysMon.git
cd SysMon
mkdir build && cd build
cmake ..
makesudo make installsysmonsysmon/
βββ include/
βββ src/
βββ tests/
Modular design with separate components for CPU, memory, process, network, and UI.
- Detailed memory view
- Disk I/O stats
- Network graphs
- Process filtering
- Custom refresh intervals
- Metrics export
Contributions are welcome. See CONTRIBUTING.md.
