ProcWatch is a lightweight, process-aware server snapshot page designed to run inside WHM (cPanel). It shows, in a single screen:
- CPU usage (incl. iowait)
- Memory + swap
- Load average
- Disk usage
- Top accounts (aggregated by process owner; PHP-FPM pool workers are attributed per-account)
- Top processes (CPU/RAM/elapsed)
- Top PHP-FPM pools (pool-level view)
This repository is intentionally simple:
- No historical charts
- No external databases
- No heavy dependencies
Scope: WHM (root / reseller). Not intended for end-user cPanel accounts.
🚀 Live preview: https://afbora.github.io/procwatch/preview.html
This plugin targets cPanel-supported Linux distributions (Linux only).
It relies on standard Linux interfaces and tools:
/proc(CPU/memory/load basics)psdfawk,sed,grep,head,sort(standard userland)
- Install/uninstall requires root.
- Runtime executes in WHM CGI context and expects access to process listing.
- Account attribution is strongest when PHP runs via per-account PHP-FPM pools (common on cPanel).
If PHP is not using per-account pools, account attribution becomes "best-effort".
The installer copies files to:
-
WHM AppConfig (registered via
register_appconfig):- Source:
adapters/whm/appconfig/procwatch.conf - cPanel stores a copy under
/var/cpanel/apps/
- Source:
-
WHM CGI:
- UI (Perl CGI that renders Template Toolkit wrapper):
/usr/local/cpanel/whostmgr/docroot/cgi/procwatch/index.cgi - Metrics JSON endpoint (bash):
/usr/local/cpanel/whostmgr/docroot/cgi/procwatch/metrics.cgi
- UI (Perl CGI that renders Template Toolkit wrapper):
-
WHM interface template (Template Toolkit):
/usr/local/cpanel/whostmgr/docroot/templates/procwatch/index.tmpl
-
Icon:
/usr/local/cpanel/whostmgr/docroot/addon_plugins/procwatch.png
-
Cache directory:
/var/cache/procwatch/(stores a short-lived JSON snapshot)
No services are started. No cron jobs are created.
git clone https://github.com/afbora/procwatch.git \
&& cd procwatch \
&& sudo bash adapters/whm/install.shgit clone https://github.com/afbora/procwatch.git
cd procwatch
# Review installer + what will be installed
sed -n '1,200p' adapters/whm/install.sh
sed -n '1,120p' adapters/whm/appconfig/procwatch.conf
# Install
sudo bash adapters/whm/install.shAfter install:
- Log into WHM
- Find ProcWatch in the left menu
- Open it to see the dashboard.
cd /root/procwatch
sudo bash adapters/whm/uninstall.shcd /root/procwatch
# Review uninstaller
sed -n '1,200p' adapters/whm/uninstall.sh
# Uninstall
sudo bash adapters/whm/uninstall.shThe CGI script produces a JSON snapshot on demand. To keep it fast, it writes a cached snapshot to:
/var/cache/procwatch/metrics.json
Cache TTL is short (default 5 seconds). The UI refreshes every 5 seconds.
- Processes are grouped by Linux process owner (user).
- PHP-FPM pool workers are detected by scanning for commands like:
php-fpm: pool <pool_name>
The dashboard shows:
- Top accounts by CPU and memory (sum of process CPU% and RSS).
- Top pools by CPU and memory with worker count.
- This is a WHM-only page intended for administrators.
- The plugin does not accept user input for executing commands.
- Output is read-only JSON + HTML.
MIT — see LICENSE.
ProcWatch is designed to be safe to run on busy servers:
- No daemon / no cron in MVP: the collector runs only when you open the WHM page.
- Short cache TTL (default: 5s): prevents expensive collection on every refresh.
- Hard timeouts:
ps/dfcollection is guarded bytimeout(when available). - Low priority execution: collection is run with
nice(andionicewhen available). - Process list hard cap:
psis capped to a fixed number of rows to avoid pathological cases. - Fail-safe output: on partial failures/timeouts, the dashboard still renders and shows a small warning indicator.
If
timeoutis not available on your system, ProcWatch falls back to best-effort execution (still cached + low priority).
By default, ProcWatch is root-only in WHM.
This is enforced via the AppConfig setting:
acls=allIn WHM, all effectively means root only, because only the root user has all privileges.
Resellers and delegated WHM users will not see the plugin.
If you explicitly want resellers or delegated users to access ProcWatch, you may relax this setting:
acls=anyAfter changing the ACL, re-register the plugin:
/usr/local/cpanel/bin/register_appconfig adapters/whm/appconfig/procwatch.conf
⚠️ ProcWatch exposes server-wide process and resource information.
Making it visible to non-root users is not recommended.