A lightweight, real-time system monitoring tool for Linux, built with C++ and ncurses. Similar to htop or top, but with a clean, colorful interface showing system statistics and process information.
-
📊 Real-time System Stats
- CPU usage with visual progress bar
- Memory utilization tracking
- System uptime display
- Process and thread counts
- OS and kernel information
-
🔄 Live Process Monitoring
- Top processes sorted by CPU usage
- Per-process CPU percentage
- Memory consumption per process
- Process uptime
- User ownership information
-
🎨 Colorful Terminal UI
- Color-coded information panels
- Progress bars for resource usage
- Auto-resizing terminal support
- Clean, organized layout
-
⏰ Time Display
- 12-hour format with AM/PM
- Egypt timezone support
- Real-time clock updates
- C++ Compiler with C++17 support (g++ recommended)
- ncurses library for terminal UI
sudo apt-get update
sudo apt-get install build-essential libncurses5-dev libncursesw5-devsudo yum install gcc-c++ ncurses-develsudo pacman -S base-devel ncursesgit clone https://github.com/yourusername/system-monitor.git
cd system-monitormakeOr compile manually:
g++ -std=c++17 -Wall -Wextra -O2 main.cpp -lncurses -o system_monitormake debug./system_monitorqorQ- Quit the application- The display updates automatically every second
make cleansystem-monitor/
├── main.cpp # Main application and ncurses display
├── ProcessParser.h # System data parsing from /proc
├── Process.h # Individual process representation
├── ProcessContainer.h # Process list management
├── SysInfo.h # System information aggregation
├── util.h # Utility functions (progress bars, time conversion)
├── constants.h # Path constants for /proc filesystem
├── Makefile # Build configuration
└── README.md # This file
The system monitor reads data from the Linux /proc filesystem:
/proc/stat- CPU statistics/proc/meminfo- Memory information/proc/uptime- System uptime/proc/[pid]/stat- Per-process statistics/proc/[pid]/status- Process status details/proc/version- Kernel version/etc/os-release- OS information
This data is parsed, processed, and displayed in a real-time ncurses interface.
Edit main.cpp and modify the sleep duration (default is 1000ms):
std::this_thread::sleep_for(std::chrono::milliseconds(1000));Modify the timezone in main.cpp:
setenv("TZ", "Africa/Cairo", 1); // Change to your timezone
tzset();Common timezones:
America/New_York- Eastern TimeAmerica/Los_Angeles- Pacific TimeEurope/London- GMTAsia/Tokyo- Japan Standard TimeAustralia/Sydney- Australian Eastern Time
Change the number of processes shown (default is 10):
NCursesDisplay::Display(sys, procs, 15); // Show 15 processes- Memory footprint: ~5-10 MB
- CPU usage: ~0.5-1% (while running)
- Update frequency: 1 second (configurable)
- No external dependencies except ncurses
- Interactive process management (kill, renice)
- Sort by different criteria (memory, PID, name)
- Search/filter processes
- Per-core CPU usage display
- Network statistics
- Disk I/O monitoring
- Configuration file support
- Color theme customization
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by
htop,top, and other system monitoring tools - Built with ncurses library
- Linux
/procfilesystem documentation
