
Linux Service Triage
- 33 installs
- 82 repo stars
- Updated August 2, 2026
- aaaaqwq/claude-code-skills
linux-service-triage is a Claude Code skill that diagnoses failing Linux services using logs, systemd/PM2, permissions, Nginx, and DNS checks and returns a minimal fix plan.
About
linux-service-triage is a Claude Code skill that diagnoses common Linux service failures. It works from logs and status output to classify the failure (config error, permission denied, port conflict, upstream unreachable, DNS mismatch) across systemd/PM2, file permissions, Nginx reverse proxy, and DNS. A developer uses it when a server app is failing, unreachable, or misconfigured. It outputs a triage report and, only with approval, the exact fix commands.
- Diagnoses failing or unreachable Linux services using logs, systemd/PM2, permissions, Nginx, and DNS
- Produces a structured triage report: symptom, evidence, likely cause, minimal fix plan, and rollback
- Read-only by default; requires explicit approval before proposing fix commands
Linux Service Triage by the numbers
- 33 all-time installs (skills.sh)
- Ranked #779 of 1,039 Cloud & Infrastructure skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
linux-service-triage capabilities & compatibility
- Capabilities
- service triage · log analysis · nginx debug · dns check · systemd debug
- Use cases
- debugging · devops
- Platforms
- Linux
- Pricing
- Free
What linux-service-triage says it does
Diagnoses common Linux service issues using logs, systemd/PM2, file permissions, Nginx reverse proxy checks, and DNS sanity checks. Use when a server app is failing, unreachable, or misconfigured.
Read-only by default: diagnose from provided outputs; do not assume you can run commands.
npx skills add https://github.com/aaaaqwq/claude-code-skills --skill linux-service-triageAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 33 |
|---|---|
| repo stars | ★ 82 |
| Last updated | August 2, 2026 |
| Repository | aaaaqwq/claude-code-skills ↗ |
What it does
Diagnose why a Linux server service is failing or unreachable and produce a minimal, verifiable fix plan.
Who is it for?
Triaging a failing or unreachable Linux service from logs and status output
Skip if: Kernel debugging, deep performance profiling, or exploiting systems
When should I use this skill?
A server app is failing, unreachable, or misconfigured and you need to find the cause from logs
What you get
A triage report with the likely cause backed by log evidence and a minimal, verifiable fix plan the service runs and listens on the expected port.
- Triage report (symptom, evidence, likely cause, minimal fix plan)
- Exact shell commands when approved and safe
- Verification and rollback steps
By the numbers
- Checks 5 areas: logs, systemd/PM2, permissions, Nginx, DNS
Files
Linux & service basics: logs, systemd/PM2, permissions, Nginx reverse proxy, DNS checks
PURPOSE
Diagnoses common Linux service issues using logs, systemd/PM2, file permissions, Nginx reverse proxy checks, and DNS sanity checks.
WHEN TO USE
- TRIGGERS:
- Show me why this service is failing using logs, then give the exact fix commands.
- Restart this app cleanly and confirm it is listening on the right port.
- Fix the permissions on this folder so the service can read and write safely.
- Set up Nginx reverse proxy for this port and verify DNS and TLS are sane.
- Create a systemd service for this script and make it survive reboots.
- DO NOT USE WHEN…
- You need kernel debugging or deep performance profiling.
- You want to exploit systems or bypass access controls.
INPUTS
- REQUIRED:
- Service type: systemd unit name or PM2 process name.
- Observed symptom: error message, status output, or logs (pasted by user).
- OPTIONAL:
- Nginx config snippet, domain name, expected upstream port.
- Filesystem paths used by the service.
- EXAMPLES:
systemctl status myappoutput +journalctlexcerpt- Nginx server block + domain + upstream port
OUTPUTS
- Default: triage report (likely cause, evidence from logs, minimal fix plan).
- If explicitly requested and safe: exact shell commands to apply the fix.
Success = service runs, listens on expected port, and reverse proxy/DNS path is correct.
WORKFLOW
1. Confirm scope and safety:
- identify service name and whether changes are permitted.
2. Gather evidence:
- status output + recent logs (see
references/triage-commands.md).
3. Classify failure:
- config error, dependency missing, permission denied, port conflict, upstream unreachable, DNS mismatch.
4. Propose minimal fix + verification steps. 5. Validate network path (if web service):
- app listens → Nginx proxies → DNS resolves → (TLS sanity if applicable).
6. Provide restart/reload plan and confirm health checks. 7. STOP AND ASK THE USER if:
- logs/status output are missing,
- actions require privileged access not confirmed,
- TLS/cert management is required but setup is unknown.
OUTPUT FORMAT
TRIAGE REPORT
- Symptom:
- Evidence (what you provided):
- Most likely cause:
- Fix plan (minimal steps):
- Exact commands (ONLY if user approved changes):
- Verification:
- Rollback:SAFETY & EDGE CASES
- Read-only by default: diagnose from provided outputs; do not assume you can run commands.
- Avoid destructive changes; require explicit confirmation for anything risky.
- Prefer
nginx -tbefore reload and verify ports withss.
EXAMPLES
- Input: “journal shows permission denied on /var/app/uploads.”
Output: path permission analysis + safe chown/chmod plan + verification.
- Input: “App works locally but domain returns 502.”
Output: upstream port checks + nginx error log interpretation + proxy_pass fix plan.
{
"ownerId": "kn7crzxy2455jgg7b1swy21gtn7zd7c2",
"slug": "linux-service-triage",
"version": "1.0.0",
"publishedAt": 1768664250014
}{
"version": 1,
"registry": "https://clawhub.ai",
"slug": "linux-service-triage",
"installedVersion": "1.0.0",
"installedAt": 1770443013337
}
linux-service-triage 集成思路
与 OpenClaw 系统的深度集成
1. Heartbeat 增强
在 HEARTBEAT.md 的基础上,加入服务健康检查:
# 每6小时执行
check_critical_services() {
services=(
"openclaw-gateway"
"nginx"
"cron"
)
for service in "${services[@]}"; do
if ! systemctl is-active --quiet "$service"; then
# 收集诊断信息
journalctl -u "$service" -n 50 > /tmp/service-triage-$service.log
# 发送告警
./skills/feishu-automation/feishu-send.sh "⚠️ 服务 $service 异常,已收集诊断信息"
fi
done
}2. 快速诊断命令包装
创建便捷命令供用户直接调用:
# ~/clawd/scripts/triage.sh
#!/bin/bash
# Linux Service 快速诊断
SERVICE=${1:-"openclaw-gateway"}
echo "=== TRIAGE REPORT: $SERVICE ==="
echo "[1] Service Status:"
systemctl status $SERVICE --no-pager
echo -e "\n[2] Recent Logs:"
journalctl -u $SERVICE -n 50 --no-pager
echo -e "\n[3] Port Listening:"
if [ "$SERVICE" = "nginx" ]; then
ss -ltnp | grep :80
ss -ltnp | grep :443
elif [ "$SERVICE" = "openclaw-gateway" ]; then
ss -ltnp | grep :3000
fi
echo -e "\n[4] Configuration Test:"
if [ "$SERVICE" = "nginx" ]; then
nginx -t
fi3. Auto-Triage Agent
结合 multi-agent-architecture,创建专门的诊断 Agent:
// skills/linux-service-triage/agent.js
{
name: "triage-agent",
trigger: "service failure detected",
actions: [
"collect_evidence",
"analyze_logs",
"propose_fix",
"verify_resolution"
]
}常见问题知识库
OpenClaw Gateway 故障模式
| 症状 | 可能原因 | 诊断命令 | 修复方法 |
|---|---|---|---|
| 无法启动 | 端口被占用 | `ss -ltnp \ | grep 3000` |
| 配置错误 | JSON 格式错误 | openclaw gateway config.get | 修复配置文件 |
| 权限错误 | 日志目录不可写 | namei -l /var/log/openclaw | 修正目录权限 |
Nginx 502 模式
| 症状 | 可能原因 | 诊断命令 | 修复方法 |
|---|---|---|---|
| 502 Bad Gateway | upstream 挂了 | curl localhost:3000 | 重启应用 |
| 502 timeout | 应用响应慢 | journalctl -u app | 优化应用性能 |
| 502 connection refused | 端口不对 | ss -ltnp | 修正 proxy_pass |
诊断速查卡
创建 /home/aa/clawd/skills/linux-service-triage/references/quick-reference.md:
# Linux Service 故障速查卡
## 🚨 紧急诊断三步法
1. systemctl status <service>
2. journalctl -u <service> -n 100
3. ss -ltnp | grep <port>
## 🔍 权限问题namei -l /path/to/file # 逐级检查权限 ls -la /path/to/file # 查看文件权限
## 🌐 网络问题ss -ltnp # 查看监听端口 curl localhost:PORT # 测试本地连接 dig +short domain.com # 测试 DNS 解析
## 📋 Nginx 问题nginx -t # 测试配置 tail -f /var/log/nginx/error.log # 实时错误日志
## 🔥 进程问题ps aux | grep name # 查找进程 kill -9 PID # 强制杀死
自动化改进
预防性监控
# 添加到 crontab
*/30 * * * * /home/aa/clawd/scripts/service-health-check.sh自愈脚本
# services/autoheal.sh
#!/bin/bash
# 服务自动恢复(需谨慎使用)
SERVICE=$1
if ! systemctl is-active --quiet "$SERVICE"; then
logger "Auto-healing: attempting to restart $SERVICE"
systemctl restart "$SERVICE"
sleep 5
if systemctl is-active --quiet "$SERVICE"; then
logger "Auto-heal successful: $SERVICE is running"
./skills/feishu-automation/feishu-send.sh "✅ $SERVICE 自动恢复成功"
else
logger "Auto-heal failed: $SERVICE still down"
./skills/feishu-automation/feishu-send.sh "🚨 $SERVICE 自动恢复失败,需要人工介入"
fi
fi与其他 Skill 的协同
+ healthcheck
- healthcheck: 配置审计、安全加固
- triage: 故障诊断、服务恢复
- 协同: 定期审计 → 发现配置问题 → triage 修复
+ docker-deployment
- 容器服务诊断
- 网络模式桥接问题
- 卷挂载权限问题
+ security-audit
- 服务权限最小化
- 日志审计
- 异常检测
持续改进
学习反馈循环
1. 记录每次故障案例 2. 提取通用模式 3. 更新知识库 4. 优化诊断脚本 5. 提高自动化程度
度量指标
- 平均诊断时间 (MTTD)
- 平均修复时间 (MTTR)
- 自动恢复成功率
- 重复故障模式识别
Linux Service Triage Commands (safe first)
Logs
- systemd:
journalctl -u <service> -n 200 --no-pager - live:
journalctl -u <service> -f - PM2:
pm2 logs <name> --lines 200
Status
- systemd:
systemctl status <service> --no-pager - ports:
ss -ltnp | grep <port> - processes:
ps aux | grep <name>
Permissions
ls -la <path>namei -l <path>(checks each directory in path)
Nginx
- config test:
nginx -t - reload:
systemctl reload nginx - logs:
/var/log/nginx/access.log,/var/log/nginx/error.log
DNS sanity
dig +short <host>dig +trace <host>
Related skills
FAQ
What does linux-service-triage check?
Logs, systemd/PM2 status, file permissions, Nginx reverse proxy config, and DNS sanity.
Will it run fix commands automatically?
No. It is read-only by default and only gives exact commands after the user approves changes.