A lightweight, terminal-based system monitoring tool for Linux, inspired by htop. Built in C, designed to run on embedded Linux systems.
- 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:SSformat from/proc/uptime - Auto-refresh — updates every second
- Quit with
q— pressqat any time to exit cleanly
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.
- GCC or any C compiler
- Linux system (tested on Linux 6.1.x)
- For ARM targets: a cross-compiler (e.g.
arm-linux-gcc)
For your host machine:
gcc -o procmon procmon.cFor ARM embedded targets (cross-compile):
arm-linux-gcc -o procmon procmon.c./procmonPress q to quit.
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
...
procmon/
├── procmon.c # main source file
└── README.md