alrcatraz/astra-sre/server-health-audit

Claude Code and agent skill by alrcatraz/astra-sre

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Systematic procedure for checking the health of any Linux server. Use this for periodic check-ins, performance investigations, or pre/post-maintenance verification.

Install

npx vskill@latest install alrcatraz/astra-sre/server-health-audit

SKILL.md

The same SKILL.md was published earlier as alrcatraz/astra-sre/server-health-audit.

Server Health Audit

Systematic procedure for checking the health of any Linux server. Use this for periodic check-ins, performance investigations, or pre/post-maintenance verification.

Methodology — Bottom-Up Layers

Work through these in order (dependency-first).

0. Establish Who Owns the Evidence Before Reading Any Log

⚠️ A clean server-side log does not mean the server is healthy for that client — it may mean the server never learned anything was wrong. When the user reports a symptom in a client (a desktop app, a remote machine that dials in), work out which end holds the evidence first. Reading only the server's logs and finding them green is a half-diagnosis, not a diagnosis.

  1. Ask which client and from where. "My desktop keeps doing X" is not

enough — get the hostname or source IPs. The fix and the logs both live on the client side. Conversely, a server log showing connection accepted is not delivery confirmation.

  1. **Confirm which transport actually carries the traffic — do not infer it

from which daemons are running. A host commonly runs several overlay/VPN clients at once (EasyTier, NetBird, ZeroTier, Tailscale) and only one carries a given flow: ```bash getent hosts <target-host> # what does the client resolve it to? ip route get <target-ip> # which interface actually carries it? ``` Zero counters on an overlay that is not** in the path are expected, not a fault. Reporting them as a broken link is a false positive — confirm the interface before concluding anything about the link.

  1. Distinguish "no error" from "no evidence". A transport that only logs

session establishment looks perfectly healthy while individual messages are lost. When the server says status=complete but the user says the result never arrived, the missing evidence is downstream — go to the client.

  1. Read the client log for the reported minute, in the client's timezone.

Daemon logs are frequently UTC while the human reports local time; convert before concluding "nothing happened then".

  1. Attribute errors to a connection scope before counting them. A client

with several configured backends/profiles emits failures for all of them, including ones not in use. An error line with no scope prefix usually belongs to the active backend; one naming another profile is often noise. Counting errors without reading their scope yields a confident, wrong root cause.

Resource contention masquerading as an application bug

A single-process server (one HTTP/WS event loop) competing for CPU with a heavy local job (compiler, indexer, training run) delivers partially: streamed content goes out over the already-open connection while the confirming/finalising request queues behind the job and blows the client's timeout. The client then discards unconfirmed output — which the user experiences as "it appeared and then vanished". Before blaming the application, check host load and who is consuming it:

bash
uptime; nproc
ps -eo pid,pcpu,etime,args --sort=-pcpu | head
free -m; swapon --show # memory AND swap together — see below

A heavy build overlapping the incident window is a first-class hypothesis, and the remedy is scheduling (move the job off the serving host, or nice / limit its parallelism), not a code change. This bites hardest on low-core hosts, where one saturated core starves the event loop of the rest.

📎 references/priority-and-resource-bounds.md — the remedy: raising a
service with CPUWeight (and why Nice=-10 is silently ignored on an
unprivileged user unit), bounding bulk jobs with a systemd-run --user --scope
wrapper, the MemorySwapMax bound that actually protects resident services,
and how to verify a scheduler setting took effect rather than merely being set.

⚠️ Read load average against swap before concluding "CPU was the problem". A load below nproc with a single hot process rules CPU out as the cause of a multi-second stall. The far more common culprit for a long-running process timing out under a heavy job is exhausted swap — once swap nears full, any allocation blocks on reclaim, which presents as a stall that looks like CPU starvation but leaves the load average unremarkable. Diagnose the two apart:

ReadingMeaning
load > nproc and one process pegged🚨 Genuine CPU saturation
load < nproc, SwapFree near 0, long-running RSS-heavy process🚨 Memory reclaim stall — the real cause despite low load
BothBoth contribute; fix memory first, it dominates the tail latency

Long-lived application processes accumulate the problem: a server up for days serving very long sessions (hundreds of turns, 100K+ token contexts) holds memory that fragments, so the margin to swap exhaustion shrinks over time. Corroborate with ss -tnp for connection counts, not just CPU.

Process liveness: zombies & self-matching probes
Full incident case study: references/ps-selfmatch-vnc-watcher.md
(camofox VNC watcher, 2026-08-03) — ps|awk matching its own command line,
stale X-socket cleanup, port-based liveness, podman exec probe pollution.
  • kill -0 <pid> returns success for zombie (defunct) processes — a dead

service whose child was never reaped passes pid-based checks. Liveness proof must come from observable state: listening port (ss -tln), socket, or actual I/O — never process presence alone.

  • ps | grep/awk <pattern> can match its own cmdline: the probe process

appears in the listing and its args contain the searched tokens (binary name, display number, resolution, port). A watcher/monitor can then believe a dead service is alive and skip restart/cleanup forever (camofox vnc-watcher 104 saga, 2026-08). For probes use pgrep -af (self-excluding); in scripts filter first: ps -eo stat=,args= | grep -v 'awk'.

  • Both traps compound: zombie + self-match = monitor sees "alive" while the

port is down. Always verify with the actual endpoint when a monitor says OK but users report failures.

📎 Reference data: references/multi-machine-memory-baseline.md has live
calibration numbers for the user's fleet — use as sanity check when assessing
an unfamiliar machine in the same class.
1. System Basics
bash
uname -a # Kernel version
hostnamectl # OS + hardware meta
uptime # Uptime + load average
free -h # Memory + swap
df -h / && lsblk # Disk usage + partition layout
nproc # CPU cores (for load context)

Load Average Interpretation:

PatternMeaning
1min > 5min > 15min📈 Rising — recent activity spike
1min < 5min < 15min📉 Falling — past peak, recovering
All ≈ equal⚖️ Steady state
All high (>> cores)🔥 Persistent overload — investigate root

Common pitfalls:

  • Load ≠ CPU usage — high load + idle CPU = processes stuck on I/O (disk/network/locks)
  • On 1-core systems, load > 1 means immediate queuing. On 8-core, load 4 is comfortable.
  • Routers can have legitimately higher load due to network softIRQ overhead (→ references/busybox-diagnostics.md)
2. Memory & Swap Pressure
bash
swapon --show # Swap device + usage %
ps aux --sort=-%mem | head -20 # Top 20 memory consumers
vmstat 1 3 # si/so columns = active swapping?

Common memory hogs on Hermes systems: orphaned MCP subprocesses, containers with no limits, accumulated kanban worker processes, desktop processes.

⚠️ Swap usage ALONE is a poor pressure signal — "high" swap ≠ memory pressure. A swap device can sit 90%+ full while the system is perfectly healthy. The decisive question is MemAvailable (from free -m / /proc/meminfo:

bash
free -m # Mem.available is the real headroom figure
grep -E "MemAvailable|SwapFree" /proc/meminfo
ConditionMeaning
Swap high (>80%) AND MemAvailable low (<~1GB)🚨 Real pressure — investigate
Swap high (>80%) AND MemAvailable ample (>~4GB)✅ Benign zombie residue — NOT a fault

Benign zombie swap (verified on DS425Plus, 2026-08): swap was 93% full (1910/2047MB) but MemAvailable was 4.5GB and used RAM only 1.16GB. Root cause: a historical memory peak (e.g. office/document suite cold loads) paged ~1.9GB of cold pages out; the kernel is not under pressure so it never reclaims them, leaving "ownerless" swapped pages idle forever. This is normal Linux behaviour.

How to prove it's residue, not pressure (run these before concluding):

bash
# 1. Ownerless swap pages: sum of per-proc VmSwap vs total swap used.
# VmSwap total << swap used ⇒ large chunk has no owner = zombie residue.
tot=0; for p in /proc/[0-9]*/status; do \
sw=$(awk '/VmSwap/{print $2}' "$p" 2>/dev/null); tot=$((tot+${sw:-0})); done; \
echo "total VmSwap: $((tot/1024)) MB"; grep SwapUsed? /proc/meminfo 2>/dev/null
# 2. Active swapping? Sample SwapFree twice ~10s apart; zero change = static, not swapping in/out.
a=$(awk '/SwapFree/{print $2}' /proc/meminfo); sleep 10; \
b=$(awk '/SwapFree/{print $2}' /proc/meminfo); echo "SwapFree Δ $((b-a)) KB"
# 3. swappiness context: cat /proc/sys/vm/swappiness (Synology ~10 = conservative,
# kernel only swaps under real pressure, so a full swap = a real past peak occurred)

If VmSwap total is far below the swap device usage AND SwapFree is static AND MemAvailable is healthy → benign, document as Watch, do not chase a leak. For a Synology DSM-specific replay see references/synology-dsm-notes.md.

Watchdog-design corollary: an alert that keys on swap usage alone fires forever on zombie residue. Gate it on swap high AND MemAvailable low (e.g. swap >1600MB && available <1024MB) so it only fires under genuine pressure.

📎 references/swap-zombie-residue-diagnosis.md — full DS425Plus case study:
concrete numbers, the VmSwap-ΔSwapFree-ΔMemAvailable proof sequence, and the
nas_watch.sh threshold fix.
🟢 Optane PMem on Xeon servers? → linux-host-admin → references/hardware/intel-optane-pmem/ (free -h
showing far less than expected is normal — reboot needed to apply goal).
→ references/ipmi-diagnostics-notes.md for IPMI/BMC tool checks.
3. Process Audit — Detect Leaks
bash
# MCP process count
ps aux | grep "mcp-" | grep -v grep | wc -l
# Total RSS for MCP processes
ps -eo pid,rss,args --sort=-rss | grep "mcp-" | grep -v grep | \
awk '{sum+=$2} END {printf "Total RSS: %.1f MB, Count: %d\n", sum/1024, NR}'
# Check age — old orphaned processes are stale
ps -eo pid,lstart,etime,rss,args --sort=pid | grep "mcp-" | grep -v grep

Leak heuristic: 3+ instances of the same MCP server, oldest >1 hour → leaking. Prevention: Prefer uvx over npx for MCP commands (simpler process tree).

Redundant proxy daemons after migration: If xray + mihomo both running after a proxy stack swap, one is likely idle. Check FD count and RSS to identify, then kill.

→ astra-sre-proxy-daemon for full proxy lifecycle.
4. Services Check
bash
systemctl list-units --type=service --state=running # Active services
systemctl --failed # Failed services

AlmaLinux ghost failures: cloud-init*, mcelog, tuned may fail once at first boot on VM images with no operational impact. Disable + reset-failed to clean up the list.

5. Network & Listening Ports
bash
ip addr show | grep -E "^[0-9]|inet " # Active interfaces
ip route show default # Default gateway
ss -tlnp # Listening TCP ports
ss -ulnp | head -15 # Listening UDP ports

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/alrcatraz/astra-sre/server-health-audit/badge)](https://verified-skill.com/skills/alrcatraz/astra-sre/server-health-audit)

Something wrong with this skill or its page? Tell us.