system-health

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

System Health Skill

System Health Skill

Check system resource usage and health status.
检查系统资源使用情况和健康状态。

When to Use

适用场景

USE this skill when:
  • User asks about system performance
  • Need to check resource usage
  • Diagnose slow performance
  • Check disk space
  • List running processes
当以下情况时使用本Skill:
  • 用户询问系统性能
  • 需要检查资源使用情况
  • 诊断性能缓慢问题
  • 检查磁盘空间
  • 列出运行中的进程

Commands

命令

CPU & Load

CPU & Load

bash
undefined
bash
undefined

System load average

System load average

uptime
uptime

CPU info

CPU info

cat /proc/cpuinfo | head -20
cat /proc/cpuinfo | head -20

Detailed CPU stats

Detailed CPU stats

mpstat 1 1 2>/dev/null || top -bn1 | head -15
undefined
mpstat 1 1 2>/dev/null || top -bn1 | head -15
undefined

Memory

Memory

bash
undefined
bash
undefined

Memory usage

Memory usage

free -h
free -h

Memory details

Memory details

cat /proc/meminfo | head -10
cat /proc/meminfo | head -10

Swap usage

Swap usage

swapon -s
undefined
swapon -s
undefined

Disk

Disk

bash
undefined
bash
undefined

Disk space (human readable)

Disk space (human readable)

df -h
df -h

Disk usage by directory

Disk usage by directory

du -sh /* 2>/dev/null | sort -hr | head -10
du -sh /* 2>/dev/null | sort -hr | head -10

Disk inodes

Disk inodes

df -i
undefined
df -i
undefined

Processes

Processes

bash
undefined
bash
undefined

Top processes by CPU

Top processes by CPU

ps aux --sort=-%cpu | head -15
ps aux --sort=-%cpu | head -15

Top processes by memory

Top processes by memory

ps aux --sort=-%mem | head -15
ps aux --sort=-%mem | head -15

Running processes count

Running processes count

ps aux | wc -l
ps aux | wc -l

Specific process check

Specific process check

ps aux | grep -E "node|python|docker" | head -10
undefined
ps aux | grep -E "node|python|docker" | head -10
undefined

Network

Network

bash
undefined
bash
undefined

Network connections

Network connections

ss -tunapl | head -20
ss -tunapl | head -20

Listening ports

Listening ports

ss -ltnp
ss -ltnp

Network interface stats

Network interface stats

ip -s link
undefined
ip -s link
undefined

System Info

System Info

bash
undefined
bash
undefined

OS version

OS version

cat /etc/os-release
cat /etc/os-release

Kernel version

Kernel version

uname -a
uname -a

System uptime

System uptime

uptime -s
undefined
uptime -s
undefined

Combined Health Check

Combined Health Check

bash
#!/bin/bash
echo "=== System Health Check ==="
echo ""
echo "Uptime: $(uptime -p)"
echo ""
echo "=== Memory ==="
free -h | grep -E "Mem|Swap"
echo ""
echo "=== Disk ==="
df -h / | tail -1
echo ""
echo "=== Top CPU ==="
ps aux --sort=-%cpu | head -6 | tail -5
echo ""
echo "=== Top Memory ==="
ps aux --sort=-%mem | head -6 | tail -5
bash
#!/bin/bash
echo "=== System Health Check ==="
echo ""
echo "Uptime: $(uptime -p)"
echo ""
echo "=== Memory ==="
free -h | grep -E "Mem|Swap"
echo ""
echo "=== Disk ==="
df -h / | tail -1
echo ""
echo "=== Top CPU ==="
ps aux --sort=-%cpu | head -6 | tail -5
echo ""
echo "=== Top Memory ==="
ps aux --sort=-%mem | head -6 | tail -5

Notes

注意事项

  • Different commands available on Linux vs macOS
  • Use
    htop
    for interactive monitoring if available
  • Check for resource-hungry processes first
  • Linux与macOS可用的命令有所不同
  • 使用
    htop
    进行交互式监控(如果可用)
  • 优先检查占用资源较多的进程