Skip to content

Safia-ElSabbagh/procmon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

procmon

A lightweight, terminal-based system monitoring tool for Linux, inspired by htop. Built in C, designed to run on embedded Linux systems.

C Linux Embedded


Features

  • CPU usage — real-time percentage with a visual bar, computed using the delta method from /proc/stat
  • Memory usage — used/total in MB with a visual bar, read from /proc/meminfo
  • Process list — live list of running processes with PID and name, scanned from /proc/[pid]/comm
  • Process count — total number of running processes
  • System uptime — displayed in HH:MM:SS format from /proc/uptime
  • Auto-refresh — updates every second
  • Quit with q — press q at any time to exit cleanly

How it works

procmon reads directly from the Linux /proc virtual filesystem — no external dependencies or libraries required beyond the C standard library.

Data Source
CPU stats /proc/stat
Memory info /proc/meminfo
Process list /proc/[pid]/comm
Uptime /proc/uptime

CPU usage is calculated using the delta method — the CPU counters are read twice, one second apart, and the difference is used to compute the usage percentage over that interval.


Requirements

  • GCC or any C compiler
  • Linux system (tested on Linux 6.1.x)
  • For ARM targets: a cross-compiler (e.g. arm-linux-gcc)

Build

For your host machine:

gcc -o procmon procmon.c

For ARM embedded targets (cross-compile):

arm-linux-gcc -o procmon procmon.c

Run

./procmon

Press q to quit.


Sample output

procmon
Press q to quit

CPU   [###-----------------]  14.23%
MEM   [############--------]  63.61%  (2352 / 3698) MB
PROC  142
UPTIME:   02:59:18

PID      NAME
________ ____________________
1        systemd
2        kthreadd
14       ksoftirqd/0
249      systemd-journal
333      systemd-udevd
...

Project structure

procmon/
├── procmon.c       # main source file
└── README.md

About

Procmon is a process monitor terminal-based system tool for Linux, inspired by htop

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages