| name | system-health |
| description | Quick system health checks for disk, memory, CPU, and processes |
| homepage | https://man7.org/linux/man-pages/ |
| metadata | {"emoji":"💊","version":"1.0.0","author":"Gourav Shah","license":"MIT","requires":{"any_bins":["top","htop","ps"]},"os":["darwin","linux"],"tags":["system","monitoring","health","sre"]} |
System Health
Quick commands for checking system health on Linux and macOS.
When to Use This Skill
Use this skill when:
- System feels slow or unresponsive
- Need to check resource usage
- Investigating high load alerts
- Before/after deployments
- Routine health checks
Quick Health Overview
One-Liner Health Check
echo "=== Load ===" && uptime && echo "\n=== Memory ===" && free -h && echo "\n=== Disk ===" && df -h / && echo "\n=== Top Processes ===" && ps aux --sort=-%cpu | head -6
echo "=== Load ===" && uptime && echo "\n=== Memory ===" && vm_stat | head -5 && echo "\n=== Disk ===" && df -h / && echo "\n=== Top Processes ===" && ps aux -r | head -6
CPU & Load
Check System Load
uptime
w
Interpreting Load Average:
- Load < CPU cores = healthy
- Load = CPU cores = fully utilized
- Load > CPU cores = overloaded
nproc
sysctl -n hw.ncpu
CPU Usage by Process
ps aux --sort=-%cpu | head -10
ps aux -r | head -10
top -o cpu
htop
Memory
Check Memory Usage
free -h
cat /proc/meminfo | head -10
vm_stat
memory_pressure
Memory by Process
ps aux --sort=-%mem | head -10
ps aux -m | head -10
Swap Usage
swapon --show
free -h | grep Swap
sysctl vm.swapusage
Disk
Disk Space
df -h
df -h /
df -i
Disk Usage by Directory
du -sh */ | sort -hr
du -h / 2>/dev/null | sort -hr | head -10
du -sh /var/log/*
Find Large Files
find / -type f -size +100M 2>/dev/null | head -20
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null | head -20
Processes
List Processes
ps aux
ps auxf
pstree
ps -u <username>
Find Specific Process
ps aux | grep <process-name>
pgrep -la <process-name>
ps aux | grep -E "PID|<process-name>" | grep -v grep
Process Details
ps -p <pid> -o pid,ppid,user,%cpu,%mem,stat,start,time,command
lsof -p <pid>
lsof -i -P -n | grep <pid>
Kill Processes
kill <pid>
kill -9 <pid>
pkill <process-name>
killall <process-name>
Network
Quick Network Check
ss -tlnp
lsof -i -P -n | grep LISTEN
netstat -tlnp
netstat -an | grep LISTEN
Active Connections
ss -tanp
netstat -an
ss -tan | awk '{print $1}' | sort | uniq -c | sort -rn
System Info
OS Information
cat /etc/os-release
uname -a
sw_vers
uname -a
Uptime & Boot Time
uptime
who -b
Hardware Info
lscpu
cat /proc/meminfo
system_profiler SPHardwareDataType
Quick Troubleshooting
| Symptom | Check | Command |
|---|
| System slow | Load average | uptime |
| High CPU | Top processes | ps aux --sort=-%cpu | head |
| Out of memory | Memory usage | free -h |
| Disk full | Disk space | df -h |
| Process hung | Process state | ps aux | grep <name> |
| Port in use | Listening ports | ss -tlnp or lsof -i :<port> |
Health Check Script
#!/bin/bash
echo "========== SYSTEM HEALTH =========="
echo ""
echo "--- Hostname & Uptime ---"
hostname && uptime
echo ""
echo "--- Load Average ---"
cat /proc/loadavg 2>/dev/null || uptime | awk -F'load average:' '{print $2}'
echo ""
echo "--- Memory ---"
free -h 2>/dev/null || vm_stat | head -5
echo ""
echo "--- Disk ---"
df -h / /var /tmp 2>/dev/null
echo ""
echo "--- Top 5 CPU ---"
ps aux --sort=-%cpu 2>/dev/null | head -6 || ps aux -r | head -6
echo ""
echo "--- Top 5 Memory ---"
ps aux --sort=-%mem 2>/dev/null | head -6 || ps aux -m | head -6
echo "===================================="
Related Skills
- docker-ops: For container resource monitoring
- k8s-debug: For Kubernetes node/pod resources
- incident-response: For systematic troubleshooting