Skip to content

itornaza/cpp-system-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux System Monitor

A system monitor for Linux developed in C++ 17 like the htop utility based on the ncurses display.

This implementation is based on the starter code for System Monitor Project in the Object Oriented Programming Course of the Udacity C++ Nanodegree Program.

System Monitor

ncurses

ncurses is a library that facilitates text-based graphical output in the terminal. This project relies on ncurses for display output.

You can install ncurses within your own Linux environment: sudo apt install libncurses5-dev libncursesw5-dev

How to build

  1. Clone the project repository: git clone https://github.com/itornaza/cpp-system-monitor.git

  2. Build the project: make build

  3. Run the resulting executable: ./build/monitor

Make

This project uses Make. The Makefile has four targets:

  • build compiles the source code and generates an executable
  • format applies ClangFormat to style the source code
  • debug compiles the source code and generates an executable, including debugging symbols
  • clean deletes the build/ directory, including all of the build artifacts

System information

System information for the process manager is derived from the following system files:

  1. Kernel information - /proc/version
  2. Operating system - /etc/os-release
  3. Memory utilization - /proc/meminfo
  4. Total processes - /proc/meminfo
  5. Running processes - /proc/meminfo
  6. Up time - /proc/uptime
  7. CPU usage - /proc/stat

Processes information also resides mainly in the /proc/ directory:

  1. PID - /proc/[pid] where pid is in any directory having an integer for its name
  2. UID - /proc/[pid]/status
  3. Username - /etc/passwd
  4. Processor utilization - /proc/[pid]/stat
  5. Memory utilization - /proc/[pid]/stat
  6. Command - /proc/[pid]/cmdline

More information about proc in the man page or enter man proc at the command line.

About

A process manager for Linux in C++ and ncurses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published