Skills Plugins MCP Prompt Model 博客 我的中心

sosreport-analyzer

一种 Linux 系统诊断和分析工具,收集系统配置、日志、性能数据并生成诊断报告

DeepseekModel Curated skill Quality Excellent · 90 v1.0.0

Get

https://deepseekmodel.com/api/download.php?id=ai-shell-team-aish-skills-sosreport-analyzer-skill-md&format=skill
Download .skill Standard format with system_prompt and model_config, ready for any agent framework
The actual content of the system_prompt field in the .skill file.
name sosreport-analyzer version 1.0.0 description 一种 Linux 系统诊断和分析工具,收集系统配置、日志、性能数据并生成诊断报告 author deepin triggers ["sosreport","system diagnostic","系统诊断","收集日志","troubleshooting","故障排查","system info","系统信息收集"] platforms ["linux"] distributions ["debian","ubuntu","rhel","centos","fedora","rocky","alma"] SOS Report Analyzer Skill 📋 功能概述 自动收集 Linux 系统的配置、日志、性能数据,并进行智能分析和问题诊断。 核心能力: ✅ 跨发行版兼容(Debian/Ubuntu/RHEL/CentOS/Fedora) ✅ 系统信息收集(硬件、内核、发行版) ✅ 日志聚合与分析(systemd、syslog、应用日志) ✅ 网络配置诊断(接口、路由、防火墙、DNS) ✅ 存储状态检查(磁盘、LVM、文件系统、挂载点) ✅ 服务状态监控(systemd units、进程树) ✅ 性能数据采集(CPU、内存、I/O、网络) ✅ 安全配置审计(SELinux/AppArmor、防火墙、审计日志) ✅ 智能问题检测与建议 🎯 使用场景 场景1:生产环境故障排查 用户: 生产服务器响应缓慢,帮我做个系统诊断 助手: 我将使用 sosreport-analyzer 收集系统数据... [执行数据收集] [分析报告] 发现问题: 1. CPU iowait 高达 45%,磁盘 /dev/sda 存在性能瓶颈 2. 内存使用 92%,swap 频繁使用 3. systemd-journald 服务占用 2GB 日志空间 场景2:系统健康检查 用户: 定期巡检,生成系统健康报告 助手: 正在收集系统状态... [生成 HTML/Markdown 报告] 场景3:迁移前评估 用户: 准备将 deepin 迁移到 UOS,先做个系统扫描 助手: 扫描兼容性问题... [检测内核模块、配置文件、软件包兼容性] 📊 数据收集模块 1. 系统基础信息(System Overview) 收集内容: # 发行版信息 - /etc/os-release - lsb_release -a - uname -a # 硬件信息 - lscpu (CPU 架构、核心数、NUMA 拓扑) - lsmem (内存配置、分布) - dmidecode (BIOS、主板、硬件序列号) - lspci (PCI 设备) - lsusb (USB 设备) - lsblk (块设备) # 虚拟化检测 - systemd-detect-virt - virt-what 分析重点: CPU 型号、频率、漏洞缓解状态 内存容量、NUMA 节点分布 虚拟化平台识别(KVM、VMware、AWS、Azure) 2. 内核与启动(Kernel & Boot) 收集内容: # 内核信息 - uname -r - cat /proc/cmdline - cat /proc/version - lsmod (已加载模块) - dmesg (启动日志) # 启动配置 - /boot/grub*/grub.cfg - /etc/default/grub - systemctl list-jobs - systemd-analyze blame (启动时间分析) 分析重点: 内核 taint 状态(污染模块) 启动参数异常(如 nomodeset、quiet) 启动性能瓶颈服务 3. 日志聚合(Logging) 收集内容: # Systemd Journal - journalctl --no-pager --since "7 days ago" -p err - journalctl --disk-usage - journalctl -u <critical-services> --since "24 hours ago" # 传统日志(如果存在) - /var/log/messages (RHEL) - /var/log/syslog (Debian/Ubuntu) - /var/log/auth.log - /var/log/secure - /var/log/audit/audit.log # 应用日志 - /var/log/nginx/ - /var/log/apache2/ - /var/log/mysql/ 智能分析: 错误日志聚合(ERROR、CRITICAL、FATAL) 异常模式识别(OOM killer、segfault、I/O errors) 重复错误统计(Top 10 错误消息) 时间线关联分析 4. 网络配置(Networking) 收集内容: # 网络接口 - ip addr show - ip link show - ip route show - ip -s link (流量统计) # 网络连接 - ss -tunap (所有连接) - netstat -i (接口统计) - arp -n # DNS 配置 - cat /etc/resolv.conf - cat /etc/hosts - cat /etc/nsswitch.conf # 防火墙 - iptables -L -n -v (如果使用) - nft list ruleset (nftables) - firewall-cmd --list-all (firewalld) - ufw status verbose (Ubuntu) # 网络服务 - systemctl status NetworkManager - nmcli connection show 诊断检查: 接口错误率(RX/TX errors、dropped packets) MTU 配置一致性 DNS 解析测试 默认网关可达性 防火墙规则冲突检测 5. 存储与文件系统(Storage) 收集内容: # 磁盘信息 - lsblk -f - fdisk -l - parted -l - blkid # 文件系统 - df -h - df -i (inode 使用率) - mount # LVM (如果使用) - pvs, vgs, lvs - pvdisplay, vgdisplay, lvdisplay # RAID (如果使用) - cat /proc/mdstat - mdadm --detail /dev/md* # 磁盘健康 - smartctl -a /dev/sda (需要 smartmontools) # I/O 性能 - iostat -x 1 5 - iotop -b -n 3 (需要 root) 风险检测: 磁盘空间使用 > 90% Inode 使用 > 80% SMART 错误计数 RAID 降级状态 LVM 快照空间不足 6. 内存与性能(Memory & Performance) 收集内容: # 内存状态 - free -h - cat /proc/meminfo - slabtop -o (内核 slab 缓存) - vmstat 1 5 # CPU 性能 - top -b -n 3 - mpstat -P ALL 1 3 - uptime # 进程信息 - ps aux -- sort =-%mem | head -20 - ps aux -- sort =-%cpu | head -20 - pstree -p # Swap 使用 - swapon -s - cat /proc/swaps 性能分析: CPU 利用率分解(user/system/iowait) 内存泄漏迹象(slab 异常增长) Top 内存/CPU 消耗进程 Swap 使用趋势 7. 服务与进程(Services) 收集内容: # Systemd 服务 - systemctl list-units -- type =service --all - systemctl --failed - systemctl list-timers # 关键服务状态 - systemctl status sshd - systemctl status NetworkManager - systemctl status firewalld # 进程树 - pstree -a - ps -eo pid,ppid,cmd, stat ,start 健康检查: 失败的服务单元 重启次数异常的服务 僵尸进程检测 孤儿进程识别 8. 安全配置(Security) 收集内容: # SELinux (RHEL/CentOS) - getenforce - sestatus - ausearch -m AVC -ts recent (AVС 拒绝日志) # AppArmor (Debian/Ubuntu) - aa-status - aa-enabled # 审计系统 - auditctl -l - aureport --summary # 登录记录 - last -20 - lastb -20 (失败登录) - who - w # SSH 配置 - cat /etc/ssh/sshd_config (敏感项模糊化) # 用户与权限 - cat /etc/passwd - cat /etc/group - find / -perm -4000 - type f 2>/dev/null (SUID 文件) 安全审计: SELinux/AppArmor 拒绝事件 异常登录尝试 SUID/SGID 可疑文件 弱 SSH 配置检测 9. 软件包管理(Packages) 收集内容: # RHEL/CentOS/Fedora - rpm -qa - dnf repolist - dnf history - dnf check # Debian/Ubuntu - dpkg -l - apt list --installed - apt-cache policy # 内核包 - rpm -qa | grep kernel (RHEL) - dpkg -l | grep linux-image (Debian) 检查项: 损坏的包依赖 可用更新统计 仓库配置验证 内核版本不一致 10. 定制化收集(Custom Collectors) 可扩展模块: # 数据库 - MySQL/PostgreSQL 配置和状态 - 数据库连接数、慢查询 # Web 服务器 - Nginx/Apache 配置检查 - 访问日志统计 # 容器 - docker info - docker ps -a - podman info # 监控代理 - Prometheus node_exporter 指标 - Zabbix agent 状态 🔍 智能分析引擎 问题检测规则库 1. 性能问题 - rule: high_cpu_iowait condition: iowait > 30 % severity: HIGH message: "CPU iowait 过高,可能存在磁盘 I/O 瓶颈" suggestions: - "检查 iostat 输出,定位慢速磁盘" - "使用 iotop 识别 I/O 密集型进程" - "考虑使用 SSD 或优化文件系统参数" - rule: memory_pressure condition: available_memory < 10 % AND swap_used > 50 % severity: CRITICAL message: "内存压力严重,系统频繁使用 swap" suggestions: - "识别内存泄漏进程并重启" - "增加物理内存" - "调整 vm.swappiness 参数" - rule: disk_space_critical condition: disk_usage > 95 % severity: CRITICAL message: "磁盘空间严重不足" suggestions: - "清理日志文件:journalctl --vacuum-time=7d" - "删除旧内核:dnf remove --oldinstallonly" - "扩展文件系统或添加新磁盘" 2. 服务异常 - rule: failed_services condition: systemctl --failed count > 0 severity: MEDIUM message: "存在失败的 systemd 服务" suggestions: - "使用 journalctl -u <service> 查看失败原因" - "检查服务依赖关系" - rule: zombie_processes condition: zombie_count > 5 severity: LOW message: "检测到僵尸进程" suggestions: - "识别父进程并修复其信号处理逻辑" - "必要时重启父进程" 3. 网络问题 - rule: packet_drops condition: rx_dropped > 1 % OR tx_dropped > 1 % severity: MEDIUM message: "网络接口丢包严重" suggestions: - "检查网卡驱动版本" - "增加 ring buffer: ethtool -G eth0 rx 4096" - "调整 net.core.netdev_max_backlog" 4. 安全风险 - rule: selinux_disabled condition: selinux_status == "disabled" severity: HIGH message: "SELinux 已禁用,系统安全性降低" suggestions: - "编辑 /etc/selinux/config 启用 SELinux" - "需要重启系统生效" - rule: ssh_root_login condition: sshd_config contains "PermitRootLogin yes" severity: MEDIUM message: "允许 root 直接 SSH 登录存在安全风险" suggestions: - "修改 /etc/ssh/sshd_config: PermitRootLogin no" - "重启 sshd: systemctl restart sshd" 📤 输出格式 1. 终端摘要(Console Summary) ═══════════════════════════════════════════════════ 系统诊断报告 - SOS Report Analyzer v1.0 ═══════════════════════════════════════════════════ 📌 系统信息 OS: Ubuntu 22.04.3 LTS Kernel: 5.15.0-91-generic Platform: VMware Virtual Platform Uptime: 45 days, 3:12:34 ⚠️ 检测到 3 个问题 [CRITICAL] 磁盘空间严重不足 /dev/sda1 使用率: 97% (仅剩 1.2GB) → 建议: journalctl --vacuum-time=7d [HIGH] CPU iowait 过高 当前 iowait: 42% → 建议: 检查 /dev/sda 性能,考虑迁移到 SSD [MEDIUM] 存在 2 个失败的服务 - systemd-networkd.service - docker.service → 建议: journalctl -u systemd-networkd ✅ 健康检查 [✓] 内存使用正常 (62%) [✓] 网络接口无丢包 [✓] SELinux 状态正常 [✓] 无僵尸进程 📊 完整报告已保存到: /tmp/sosreport-20260105-143022.tar.gz 2. Markdown 报告(Detailed Report) # 系统诊断报告 **生成时间:** 2026-01-05 14:30:22 **主机名:** prod-web-01 **报告版本:** sosreport-analyzer v1.0 ## 执行摘要 本次诊断发现 **3 个关键问题** 和 **5 个优化建议** 。 ### 严重问题 1. ❌ 磁盘空间不足(/dev/sda1 97%) 2. ⚠️ CPU iowait 异常(42%) 3. ⚠️ 2 个服务失败 ### 系统概览 - **操作系统:** Ubuntu 22.04.3 LTS (Jammy Jellyfish) - **内核:** 5.15.0-91-generic - **CPU:** Intel Xeon E5-2680 v4 @ 2.40GHz (8 cores) - **内存:** 16GB (使用 62%) - **运行时间:** 45 天 [详细章节...] 3. JSON 数据(Machine-Readable) { "metadata" : { "version" : "1.0.0" , "timestamp" : "2026-01-05T14:30:22Z" , "hostname" : "prod-web-01" , "collector" : "sosreport-analyzer" } , "system" : { "os" : { "distribution" : "Ubuntu" , "version" : "22.04.3 LTS" , "codename" : "Jammy Jellyfish" } , "kernel" : "5.15.0-91-generic" , "hardware" : { "cpu" : { "model" : "Intel Xeon E5-2680 v4" , "cores" : 8 , "threads" : 16 } , "memory" : { "total_gb" : 16 , "used_percent" : 62 } } } , "issues" : [ { "severity" : "CRITICAL" , "category" : "storage" , "title" : "Disk space critical" , "details" : "/dev/sda1 usage: 97%" , "recommendations" : [ "journalctl --vacuum-time=7d" , "Clean old kernels" , "Expand filesystem" ] } ] , "health_checks" : { "memory" : "PASS" , "network" : "PASS" , "services" : "WARN" , "security" : "PASS" } } 🛠️ 使用方法 基础用法 # 在 Claude Code 中触发 帮我做个系统诊断 运行 sosreport 收集系统信息 系统健康检查
Keywords that activate this skill. Click one to copy it.

This skill does not provide trigger words.

The downloaded .skill package contains the following fields.
Field Description
formatFormat tag (skill/v1)
skill_idUnique skill ID
nameSkill name
versionVersion
descriptionDescription
categoryCategories (array)
trigger_wordsTrigger words
tagsTags
sourceSource
source_urlSource URL (this page)
exported_atExported at (set per download)
system_promptSystem prompt body
model_configModel config: provider / model / temperature / max_tokens / top_p
examplesExamples
install_guideImport guide for Coze / Dify / Claude / custom frameworks
The same skill can be exported in different platform formats.
.skill Standard format with system_prompt and model_config, ready for any agent framework Download
.skillpro Enhanced format with scripts, tools, dependencies and hooks Download
.json Plain JSON export with system_prompt and model parameters only Download
Coze Markdown with frontmatter, for Coze platform import Download
Dify Dify DSL, import directly after creating an app Download

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

验证码 --

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。