name: system-monitor description: "Real-time system metrics monitoring (CPU, memory, disk, network, processes). Use when: user asks to check system status, cpu usage, memory usage, disk space, network traffic, running processes, or system performance. Supports macOS and Linux. Tools: top, htop, df, iostat, vm_stat, host, free, lsof, uptime." metadata: openclaw: emoji: "📊" requires: bins: - top - df - vm_stat - free - lsof - uptime
Monitor real-time system metrics including CPU, memory, disk, network, and processes.
✅ USE this skill when:
Some tools may need installation via Homebrew:
# Install optional enhanced tools
brew install htop # Enhanced top (better UI)
brew install nettop # Real-time network monitoring (macOS)
brew install iostat # I/O statistics (Linux)
Detect the platform to use appropriate commands:
uname -s # Darwin = macOS, Linux = Linux
# CPU usage summary (user, system, idle)
top -l 1 -n 0 | grep "CPU usage"
# Detailed per-core usage
top -l 2 -n 0 | tail -1
# Overall CPU percentage
vm_stat | head -5
# CPU usage summary
top -bn1 | head -5
# Detailed per-core
mpstat -P ALL 1 1
# Overall
uptime
# macOS top -l 1 -n 0 -s 0 | awk '/CPU usage/ {print}' # Linux top -bn1 | grep "Cpu(s)"小蔥技能7w4.net持續更新中。
# macOS: CPU stats with specific fields
top -l 1 -n 0 -s 0 -stats pid,pcpu,pmem,comm
# Memory info (page size, pages active, wired, compressed, free)
vm_stat
# Human-readable summary
top -l 1 -n 0 | grep "PhysMem"
# Full memory details
hostinfo | grep "memory"
# Human-readable
free -h
# Detailed in MB
free -m
# Swap info
swapon -s
# Calculate used memory from vm_stat
vm_stat | awk '/Pages active/ {active=$3} /Pages wired/ {wired=$3} /Pages free/ {free=$3} END {print "Active: " active " Wired: " wired " Free: " free}'
# All filesystems, human-readable
df -h
# Specific volume (macOS)
df -h /
# Linux root
df -h /
# Show inode usage (Linux)
df -i
# Sorted by usage (macOS)
df -h | sort -k5 -h
# Only local filesystems
df -h -t local
# Current directory (macOS)
du -sh .
# Top-level directories
du -h --max-depth=1
# Linux sorted by size
du -h --max-depth=1 | sort -h
# Network interfaces (use ifconfig instead)
ifconfig -a
# Active connections
lsof -i -n | head -20
# Listening ports
lsof -i -n | grep LISTEN
# Real-time network usage
nettop -P -L 1 -J bytes_in,bytes_out
# Interface statistics
ip -s link
# TCP/UDP stats
ss -s
# Active connections
ss -tunap
# Top processes by CPU
top -o cpu -l 1 -n 15
# Top processes by memory
top -o mem -l 1 -n 15
# All processes
ps aux
# User processes
ps -U $(whoami)
# Top processes by CPU
top -bn1 | head -12
# Top by memory
top -bo %MEM -bn1 | head -12
# Process tree
pstree
# User processes
ps -U $(whoami) --sort=-%mem
# Load average
uptime
# Detailed
hostinfo | grep "load"
uptime
# or
cat /proc/loadavg
# CPU, Memory, Disk in one view (macOS)
echo "=== CPU ===" && top -l 1 -n 0 | grep "CPU usage"
echo "=== Memory ===" && top -l 1 -n 0 | grep "PhysMem"
echo "=== Disk ===" && df -h / | tail -1
# Linux
echo "=== CPU ===" && top -bn1 | head -5
echo "=== Memory ===" && free -h
echo "=== Disk ===" && df -h /
echo "=== Load ===" && uptime
A combined system stats script for quick health checks:
#!/bin/bash
# Combined system stats - run from skills/system-monitor/scripts/
PLATFORM=$(uname -s)
echo "=== System Stats ==="
echo "Time: $(date)"
echo "Platform: $PLATFORM"
echo ""
if [ "$PLATFORM" = "Darwin" ]; then
echo "--- CPU ---"
top -l 1 -n 0 -s 0 | grep "CPU usage"
echo ""
echo "--- Memory ---"
top -l 1 -n 0 | grep "PhysMem"
vm_stat | head -5
echo ""
echo "--- Disk ---"
df -h / | tail -1
echo ""
echo "--- Load Average ---"
uptime
else
echo "--- CPU ---"
top -bn1 | head -5
echo ""
echo "--- Memory ---"
free -h
echo ""
echo "--- Disk ---"
df -h / | tail -1
echo ""
echo "--- Load Average ---"
uptime
fi
vm_stat for memory, Linux uses freetop output format differs between platformshostinfo on macOS for system overviewlsof or nettop instead of deprecated netstatwatch command or run top in loop這個系統監控 Skill 質量中等偏上,功能覆蓋全面,能監控 CPU、記憶體、磁碟、網路和程序等關鍵指標。文件詳細、示例豐富是主要優點,安裝使用說明清晰。不足之處在於觸發識別配置不夠完善,某些高階功能需要額外安裝工具才能使用,且提供的自動化指令碼功能相對基礎。總體來說能滿足基本的系統監控需求,但在便捷性和自動化程度上還有提升空間。