Live system monitoring with web UI, CLI mode, and signal handling.
A lightweight Linux system monitor that shows you what's happening on your machine in real-time. Open a browser, check CPU/memory/disk usage, see which processes are hogging resources. Built with Bash and Python, no bloat.
Key points:
- Real-time metrics (CPU, memory, disk, I/O, processes, load, uptime)
- Web dashboard + JSON API
- Signal-based refresh (SIGUSR1)
- Graceful shutdown (SIGINT/SIGTERM)
- Works in terminal too (headless mode)
./run.sh --help
--host HOST Host to bind (default: 127.0.0.1)
--port PORT HTTP port (default: 8000)
--interval SEC Metric refresh interval (default: 2)Dashboard shows:
- CPU usage + load average
- Memory/swap usage
- Disk I/O rates
- Active processes count
- System uptime
- Per-core CPU breakdown
- Top 5 by CPU and memory
- System alerts (high CPU/memory/disk)
./run.shOpen http://127.0.0.1:8000 in browser. Done.
The dashboard handles signals for refresh and graceful shutdown.
Manages both server and monitor processes.
SIGUSR1 — forwards refresh signal to monitor
kill -USR1 $(cat runtime/run.pid)SIGINT — graceful shutdown (Ctrl+C)
kill -INT $(cat runtime/run.pid)
# Output: Received signal: SIGINT. Stopping…SIGTERM — terminate gracefully
kill -TERM $(cat runtime/run.pid)
# Output: Received signal: SIGTERM. Stopping…Responds to refresh and shutdown signals independently.
SIGUSR1 — immediate metric refresh (don't wait for interval)
kill -USR1 $(cat runtime/monitor.pid)
# Triggers refresh_all() immediatelySIGINT — exit with status
kill -INT $(cat runtime/monitor.pid)
# Output: Received signal: SIGINT. Exiting…SIGTERM — exit with status
kill -TERM $(cat runtime/monitor.pid)
# Output: Received signal: SIGTERM. Exiting…# Get metrics
curl http://127.0.0.1:8000/api/metrics | jq
# Trigger refresh
curl http://127.0.0.1:8000/api/refresh | jq
# Health check
curl http://127.0.0.1:8000/api/health | jq./demo_signals.shShows signal handling in action:
- Start monitor in background
- Send SIGUSR1 (refresh)
- Send SIGINT (shutdown)
- Show results
Terminal 1:
./run.sh --port 8083Terminal 2:
# Get PIDs
MONITOR_PID=$(cat runtime/monitor.pid)
RUN_PID=$(cat runtime/run.pid)
# Test SIGUSR1 on run.sh (forwards to monitor)
kill -USR1 $RUN_PID
# Test SIGINT on monitor directly
kill -INT $MONITOR_PID
# Or use run.sh orchestrator
kill -INT $RUN_PIDWatch the console output to see which signals are received.
Run monitor without dashboard (background operation):
./monitor.sh --headless --interval 2 --log-file logs/system_health.logWrites metrics to files only, no terminal output.
runtime/monitor.pid— monitor process IDruntime/run.pid— orchestrator process IDruntime/metrics.env— current system snapshotruntime/cpu_cores.csv— per-core CPU usageruntime/top_cpu.csv/top_mem.csv— top processesruntime/alerts.txt— active alertslogs/system_health.log— metric history
- CPU ≥ 85%
- Memory ≥ 80%
- Disk ≥ 85%
Port in use?
./run.sh --port 8001Metrics not updating?
tail -f logs/system_health.log
kill -USR1 $(cat runtime/monitor.pid)Won't shut down cleanly?
pkill -9 -f monitor.sh
pkill -9 -f server.pyNeed to see what's running?
ps aux | grep -E '(run|monitor|server)'