/server-setup:server-diagnosticsfrom server-setup
Debug server availability and performance using metrics, logs, benchmarks, and network tests. Diagnose outages, slowness, resource exhaustion, packet loss, and IP reputation across any workload.
Ships in server-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Applies to any workload. Examples below are illustrations, not a checklist — work out what matters for the system in front of you.
These are inspect / one-off jobs in infra-iac's task intake: they leave every server
exactly as found. When the outcome needs a lasting change (tuning, capacity, config,
firewall, monitoring), hand over to infra-iac's change loop.
--help before each use; build commands from what it says
today. Fall back to standard tools when something is missing or behaves differently.{{ hostvars['<host>'].ansible_host }}). Identifiers (IPs, ports)
may be read when needed, but keep them out of repo files and reports you write there;
credentials are never printed. Mask IPs in outputs you paste into reports (filter
below).make shell H=<host|group> -- <cmd> (or CMD='…' with quotes/=; sudo by default,
SUDO=0 for the login user; a .become_pass file is used automatically if sudo needs a
password), make module H=… M=<module> A='<args>' for any module
(EXTRA='-B 300 -P 0' for background jobs), make docker-logs, make var. No project: an
inventory the user prepares, or their ~/.ssh/config aliases.# IP mask — pipe any output through this before reading it
sed -E 's/\b([0-9]{1,3}\.){3}[0-9]{1,3}\b/<ipv4>/g; s/\b([0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{1,4}\b/<ipv6>/g'
git log --since), recent applies, image/version bumps, provider
maintenance, traffic changes, certificate expiry, make check drift (manual changes).Find out what exists — probe, don't assume. Typical places (illustrative):
| Source | How to find it | Gives |
|---|---|---|
| Metrics servers (Prometheus, VictoriaMetrics, Thanos, Mimir…) | inventory/apps_list/k8s manifests, ss -ltnp on the monitoring host, docker ps | history: query …/api/v1/query_range from that host (curl localhost:<port>), ALERTS for firing alerts |
Exporters on targets (node, nginx, docker daemon, cAdvisor, blackbox, app /metrics) | collection vars (node_exporter_*, nginx_exporter_*, node_docker_metrics_*), ss -ltnp | current values directly; history via the metrics server |
| Dashboards / alerting (Grafana, Alertmanager, uptime checkers) | inventory, apps, DNS names in the repo | what alerted and when; ask the user for screenshots if you can't reach it |
| Logs (journald, Loki/Promtail, nginx/WAF logs, container logs, k8s events) | journalctl --list-boots, nginx_promtail_*, make docker-logs | error timelines, restarts, OOM kills |
| Kubernetes | kubectl top, metrics-server, kube-state-metrics, get events, Prometheus operator | pod/node usage, restarts, evictions, scheduling |
Host history (sysstat sar, atop logs, last -x, /var/log) | presence check on host | CPU/IO/net history without a metrics stack |
| Provider console | ask the user | host-level CPU/net graphs, maintenance events, DDoS mitigation |
If little exists, say so and suggest (as an IaC change) the minimal observability that would have answered the question — e.g. enabling exporters already in the collection.
dmesg,
provider events), the service (systemd NRestarts, container restart counts, k8s
CrashLoop/OOMKilled/evictions), the network (loss, routing, upstream blocks), or a
resource run out (disk/inodes full, memory/OOM, conntrack/fd limits, cert expiry)?
Flapping → correlate with timers/cron, backups, traffic peaks, autoscaling, health-check
thresholds.Command cookbook and common failure patterns: references/debugging.md.
Servers configured by the collection's node role usually already have helper scripts:
its bootstrap installs the user's dotfiles scripts into the admin user's ~/.local/bin
(run as that user, or by full path). Check presence before anything else:
make shell H=<host> SUDO=0 CMD='ls ~/.local/bin; command -v sysbench fio iperf3 mtr'
Helpers you may find there (names and options may change — read --help):
Fallback order when a tool is missing: install the standard package temporarily → fetch the
helper on the controller (https://raw.githubusercontent.com/ahmz1833/dots/main/scripts/<name>)
and run it with make module H=<host> SUDO=0 M=ansible.builtin.script A='<local path> <args>'
(copies, runs, deletes; works for hosts without GitHub access) → standard tools (sysbench, fio, iperf3, mtr, curl -w, dd oflag=direct).
Check dependencies (install temporarily if needed), run short tests in a disk location with enough space, clean up. Compare only like with like (same tool version and options). Look for poor multi-thread scaling and high steal (oversubscribed host), direct vs buffered disk gaps, run-to-run noise (repeat when unsure).
The iperf3 server exists only for the test window:
HOST-FIREWALL;
otherwise the nft/ufw setup you find). Account for NAT and provider security groups.make module H=<srv> M=ansible.builtin.command A='timeout 240 iperf3 -s -p <port>' EXTRA='-B 300 -P 0'
(or one-shot mode if available).-R), ~10 s each; optionally parallel
streams (-P N) to separate per-flow from link limits; target the server via
{{ hostvars['<srv>'].ansible_host }} or its private address. For tunnels/VPNs, test both
the underlay (host to host) and through the tunnel to see the overhead.iperf3 -c iperf3.moji.fr -p 5210 (and -R) is a good international default; public
servers get busy — retry later or use another. Add mtr towards the regions that matter and
an HTTP download test where iperf3 is blocked.
Run the egress checker on the host itself (it evaluates the host's own egress), with the mail-domain option for mail senders. Use its own verdicts; mask IPs before reading. Explain consequences: geo mismatches (services may geo-block), blacklist/fraud hits (change IP or provider), port 25 blocked or missing PTR (mail not viable until fixed with the provider), blocked AI/streaming/social services (other region or egress route).
infra-iac (IaC change loop).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub ahmz1833/server-setup --plugin server-setup4 skills in this plugin
/infra-bootstrapCreate a new infrastructure-as-code project (Ansible + ahmz1833.server_setup collection) for a server, a set of servers, a cluster, or a new organization/startup/event - from an interview to a runnable, vaulted, validated repo. Use when the user wants to set up, provision or bootstrap new servers/infrastructure and there is no IaC repo for it yet, or asks for a new infra repo. For changing an existing project use infra-iac instead./infra-iacOperate servers and infrastructure the IaC way - Ansible with the ahmz1833.server_setup collection as the baseline, plus local roles, DNS/cloud (Terraform/OpenTofu, provider modules) and Kubernetes manifests where needed. Use for ANY request touching servers, clusters, DNS, networks or an infrastructure repository - inspecting or debugging hosts ("why is X down", "check disk"), one-off jobs ("restart nginx", "reboot", "drain node", "fetch kubeconfig"), and persistent changes ("open a port", "add a site/app/user/host", "change config", "upgrade k3s"). Enforces that state changes go through code, secrets and exposure-sensitive values go to ansible-vault (repo assumed public), and that attack surface is minimized and risks are reported. Routes to infra-bootstrap for new projects and server-setup-dev for work on the collection itself./server-setup-devDevelop, fix or extend the ahmz1833.server_setup Ansible collection itself (its roles core, node, nginx, acme, apps, sandbox, k3s, mail, asset; argument specs; docs; examples; skills) - or upstream a generic local role into it. Use when working inside the server-setup repository, when a project needs a feature the collection lacks, or when a collection bug is found while operating infrastructure. Covers both maintainers (write access, release workflow) and non-owners (local workaround + issue/PR).