Skip to main content

Resource Monitoring

Learning Focus

By the end of this lesson you will know which OS-level commands to use alongside WebAdmin for comprehensive monitoring.

Key Commands

ResourceCommandWhat to Watch
CPUtop, htopHigh CPU from lshttpd or lsphp
Memoryfree -hSwap usage, available memory
Diskdf -h, iostatPartition fullness, I/O wait
Networknetstat -an, ss -sConnection counts, states
Processesps aux | grep lshttpdWorker count and memory per worker

Quick Health Check Script

#!/bin/bash
echo "=== CPU Load ==="
uptime

echo "=== Memory ==="
free -h

echo "=== Disk ==="
df -h /

echo "=== OLS Connections ==="
netstat -an | grep -c ":443.*ESTABLISHED"

echo "=== PHP Workers ==="
ps aux | grep lsphp | grep -v grep | wc -l

Key Takeaways

  • Combine WebAdmin dashboard with OS-level tools for full visibility.
  • Watch for swap usage — it is the first sign of memory pressure.
  • Monitor disk space — full disks cause log failures and crashes.

What's Next