Skill: yushimohuang/system-monitor-tool (version 1.0.0)

--- name: system-monitor description: System resource monitoring (CPU, memory, disk, network). Use when user asks "system status", "CPU usage", "memory usage", "disk space", or wants to monitor system resources. --- # System Monitor Monitor system resources in real-time. ## Commands ### System Overview When user says: "system status", "how's the system" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh status ``` ### CPU Usage When user says: "CPU usage", "how's CPU" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh cpu ``` ### Memory Usage When user says: "memory usage", "RAM status" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh memory ``` ### Disk Usage When user says: "disk space", "storage status" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh disk ``` ### Network Status When user says: "network status", "connection info" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh network ``` ### Process List When user says: "top processes", "what's using CPU" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh processes [--top 10] ``` ### Temperature (if available) When user says: "CPU temperature", "system temp" ```bash bash skills/system-monitor-1.0.0/scripts/monitor.sh temp ``` ## Examples ```bash # Full system status bash skills/system-monitor-1.0.0/scripts/monitor.sh status # Check disk space bash skills/system-monitor-1.0.0/scripts/monitor.sh disk # Top 5 processes bash skills/system-monitor-1.0.0/scripts/monitor.sh processes --top 5 # Monitor mode (continuous) bash skills/system-monitor-1.0.0/scripts/monitor.sh watch --interval 5 ``` ## Response Format ``` 🖥️ **System Status** (2026-03-10 12:30:00) **CPU:** 25% (4 cores) **Memory:** 8.2GB / 16GB (51%) **Disk:** 256GB / 512GB (50%) **Network:** 🟢 Connected (WiFi) **Uptime:** 3 days, 4 hours ```

path: README.md
content: # System Monitor Skill

System resource monitoring for OpenClaw.

## Features

- ✅ CPU usage and info
- ✅ Memory monitoring
- ✅ Disk space analysis
- ✅ Network status
- ✅ Process listing
- ✅ Temperature (Linux)
- ✅ Watch mode (continuous)

## Usage

### System Overview
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh status
```

### CPU
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh cpu
```

### Memory
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh memory
```

### Disk
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh disk
```

### Network
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh network
```

### Top Processes
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh processes --top 10
```

### Watch Mode
```bash
bash skills/system-monitor-1.0.0/scripts/monitor.sh watch --interval 5
```

## Platform Support

| Feature | Linux | macOS | Windows |
|---------|-------|-------|---------|
| CPU     | ✅    | ✅    | ⚠️ Limited |
| Memory  | ✅    | ✅    | ⚠️ Limited |
| Disk    | ✅    | ✅    | ✅ |
| Network | ✅    | ✅    | ⚠️ Limited |
| Temp    | ✅    | ⚠️ Needs iStats | ❌ |

## License

MIT


path: scripts/monitor.sh
content: #!/bin/bash
# System Monitor - Resource monitoring
# Version: 1.0.0

# Get OS type
get_os() {
    case "$(uname -s)" in
        Darwin*)    echo "macos";;
        Linux*)     echo "linux";;
        MINGW*|MSYS*|CYGWIN*) echo "windows";;
        *)          echo "unknown";;
    esac
}

# System status overview
system_status() {
    local os=$(get_os)
    local timestamp=$(date "+%Y-%m-%d %H:%M:%S")
    
    echo "🖥️  System Status ($timestamp)"
    echo ""
    
    case "$os" in
        macos)
            # CPU
            local cpu=$(ps -A -o %cpu | awk '{s+=$1} END {print s / NR * 100}' | cut -d. -f1)
            local cores=$(sysctl -n hw.ncpu)
            echo "**CPU:** ${cpu}% ($cores cores)"
            
            # Memory
            local mem_used=$(vm_stat | awk '/Pages active/ {print $3}' | tr -d '.')
            local mem_total=$(sysctl -n hw.memsize | awk '{print $1/1024/1024/1024}')
            echo "**Memory:** ${mem_used}GB / ${mem_total}GB"
            
            # Disk
            df -h / | awk 'NR==2 {print "**Disk:** " $3 " / " $2 " (" $5 ")"}'
            
            # Uptime
            uptime | awk -F',' '{print "**Uptime:** " $1}' | sed 's/up/Uptime:/'
            ;;
            
        linux)
            # CPU
            local cpu=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}' | cut -d% -f1)
            local cores=$(nproc)
            echo "**CPU:** ${cpu}% ($cores cores)"
            
            # Memory
            free -h | awk 'NR==2 {print "**Memory:** " $3 " / " $2 " (" $3/$2*100 "%)"}'
            
            # Disk
            df -h / | awk 'NR==2 {print "**Disk:** " $3 " / " $2 " (" $5 ")"}'
            
            # Uptime
            uptime -p 2>/dev/null || uptime | awk -F',' '{print "**Uptime:** " $1 $2}'
            ;;
            
        windows)
            echo "**OS:** Windows"
            echo "Note: Full monitoring requires PowerShell scripts"
            ;;
    esac
    
    echo ""
    echo "**Network:** $(check_network)"
}

# Check network status
check_network() {
    if ping -c 1 8.8.8.8 &>/dev/null; then
        echo "🟢 Connected"
    else
        echo "🔴 Disconnected"
    fi
}

# CPU details
cpu_info() {
    local os=$(get_os)
    
    echo "📊 CPU Information"
    echo ""
    
    case "$os" in
        macos)
            sysctl -n machdep.cpu.brand_string
            echo "Cores: $(sysctl -n hw.ncpu)"
            echo "Threads: $(sysctl -n hw.logicalcpu)"
            ;;
        linux)
            lscpu | grep -E "Model name|CPU\(s\)|Thread"
            ;;
    esac
    
    echo ""
    echo "Current Usage:"
    case "$os" in
        macos)
            top -l 1 | grep -E "CPU usage|Load Avg"
            ;;
        linux)
            top -bn1 | head -5
            ;;
    esac
}

# Memory details
memory_info() {
    local os=$(get_os)
    
    echo "📊 Memory Information"
    echo ""
    
    case "$os" in
        macos)
            vm_stat | head -10
            echo ""
            echo "Total: $(sysctl -n hw.memsize | awk '{printf "%.1f GB", $1/1024/1024/1024}')"
            ;;
        linux)
            free -h
            echo ""
            cat /proc/meminfo | head -10
            ;;
    esac
}

# Disk details
disk_info() {
    echo "📊 Disk Information"
    echo ""
    df -h
    echo ""
    echo "Top 5 largest folders in home:"
    du -sh ~/* 2>/dev/null | sort -hr | head -5
}

# Network details
network_info() {
    local os=$(get_os)
    
    echo "📊 Network Information"
    echo ""
    
    case "$os" in
        macos)
            ifconfig | grep -E "inet |flags" | head -20
            ;;
        linux)
            ip addr | grep -E "inet |state" | head -20
            ;;
    esac
    
    echo ""
    echo "Default Gateway:"
    netstat -rn | grep default | head -3
}

# Process list
process_list() {
    local top="${2:-10}"
    
    echo "📊 Top $top Processes by CPU"
    echo ""
    
    case "$(get_os)" in
        macos|linux)
            ps aux --sort=-%cpu | head -$((top + 1))
            ;;
    esac
}

# Temperature (if available)
temp_info() {
    local os=$(get_os)
    
    echo "📊 Temperature"
    echo ""
    
    case "$os" in
        linux)
            if [ -f /sys/class/thermal/thermal_zone0/temp ]; then
                cat /sys/class/thermal/thermal_zone0/temp | awk '{printf "CPU: %.1f°C\n", $1/1000}'
            else
                echo "Temperature sensor not available"
            fi
            ;;
        macos)
            echo "Install iStats for temperature monitoring:"
            echo "  gem install iStats"
            ;;
    esac
}

# Watch mode
watch_mode() {
    local interval="${2:-5}"
    
    echo "Starting monitor (Ctrl+C to stop)..."
    while true; do
        clear
        system_status
        sleep "$interval"
    done
}

# Show help
show_help() {
    echo "System Monitor - Resource monitoring"
    echo ""
    echo "Usage:"
    echo "  monitor.sh status      - System overview"
    echo "  monitor.sh cpu         - CPU information"
    echo "  monitor.sh memory      - Memory information"
    echo "  monitor.sh disk        - Disk usage"
    echo "  monitor.sh network     - Network status"
    echo "  monitor.sh processes   - Top processes"
    echo "  monitor.sh temp        - Temperature"
    echo "  monitor.sh watch       - Continuous monitoring"
    echo ""
}

# Main
case "$1" in
    status)
        system_status
        ;;
    cpu)
        cpu_info
        ;;
    memory)
        memory_info
        ;;
    disk)
        disk_info
        ;;
    network)
        network_info
        ;;
    processes)
        process_list "$@"
        ;;
    temp)
        temp_info
        ;;
    watch)
        watch_mode "$@"
        ;;
    *)
        show_help
        ;;
esac


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)