Skip to content

Houdini-Y/Task-Manager

Repository files navigation

System Monitor

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.

System Monitor Screenshot

Features

  • 📊 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

Prerequisites

Required Libraries

  • C++ Compiler with C++17 support (g++ recommended)
  • ncurses library for terminal UI

Installation

Ubuntu/Debian

sudo apt-get update
sudo apt-get install build-essential libncurses5-dev libncursesw5-dev

CentOS/RHEL/Fedora

sudo yum install gcc-c++ ncurses-devel

Arch Linux

sudo pacman -S base-devel ncurses

Building from Source

Clone the Repository

git clone https://github.com/yourusername/system-monitor.git
cd system-monitor

Compile

make

Or compile manually:

g++ -std=c++17 -Wall -Wextra -O2 main.cpp -lncurses -o system_monitor

Debug Build

make debug

Usage

Run the Monitor

./system_monitor

Controls

  • q or Q - Quit the application
  • The display updates automatically every second

Clean Build Files

make clean

Project Structure

system-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

How It Works

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.

Configuration

Change Update Interval

Edit main.cpp and modify the sleep duration (default is 1000ms):

std::this_thread::sleep_for(std::chrono::milliseconds(1000));

Change Timezone

Modify the timezone in main.cpp:

setenv("TZ", "Africa/Cairo", 1);  // Change to your timezone
tzset();

Common timezones:

  • America/New_York - Eastern Time
  • America/Los_Angeles - Pacific Time
  • Europe/London - GMT
  • Asia/Tokyo - Japan Standard Time
  • Australia/Sydney - Australian Eastern Time

Adjust Process Display Count

Change the number of processes shown (default is 10):

NCursesDisplay::Display(sys, procs, 15);  // Show 15 processes

Performance

  • Memory footprint: ~5-10 MB
  • CPU usage: ~0.5-1% (while running)
  • Update frequency: 1 second (configurable)
  • No external dependencies except ncurses

Future Enhancements

  • 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by htop, top, and other system monitoring tools
  • Built with ncurses library
  • Linux /proc filesystem documentation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors