System Administration Prompt Cheatsheet

Quick-reference prompt templates for system administration, DevOps, and troubleshooting tasks.

By Chat Overview Published Updated
Operations prompt
System
State
Goal
Safety
Verify each step
  • Dry run
  • Review
  • Check

How to use this sheet

Choose a pattern, add the exact system state and safety limits, then review every command before use. See Prompt Engineering for System Administration for the full method.

Script generation

PatternExample promptCheck for
Disk monitoringWrite a Bash script for Ubuntu 22.04 that checks disk usage on / every hour and emails an alert if usage exceeds 80 percent.Inspect units, quoting, mail failure handling, privileges, and cron environment.
Process monitoringCreate a PowerShell script that lists all processes consuming more than 200MB RAM, sorted by usage.Check units, filtering, sorting, access errors, and PowerShell version.
Log rotationWrite a Bash script to rotate logs in /var/log/myapp/ weekly, keeping 4 backups.Check whether the result is a script or logrotate configuration, then test rotation and retention.

Config generation

PatternExample promptCheck for
Web serverGenerate an Nginx reverse proxy config for a Flask app on port 5000, including TLS with Let's Encrypt.Check syntax, certificate paths, proxy headers, and current TLS guidance.
DatabaseWrite a PostgreSQL pg_hba.conf that allows local connections for role appuser but denies remote access.Access control config with explicit host rules.
KubernetesProvide Kubernetes YAML to deploy Redis with a PersistentVolumeClaim for storage.Check object types, storage class, resource limits, credentials, and recovery behavior.

Log analysis

PatternExample promptCheck for
Web logsAnalyze this Apache access log and summarize the 3 most common HTTP status codes.Recalculate counts with a separate command and check malformed lines.
Database logsHere are 50 lines from a MySQL error log. Identify recurring errors and likely causes.Separate quoted evidence from possible causes.
System logsReview this syslog snippet and explain which service is failing and why.Require a service name, quoted evidence, and unresolved assumptions.

Security audits

PatternExample promptCheck for
SSHAudit this sshd_config and list insecure settings. Suggest safer alternatives.Verify each finding against the installed sshd_config manual page.
NginxReview this nginx.conf for security hardening. Assess CSP and HSTS for this deployment.Check context, version support, syntax, and deployment-specific effects.
ContainersGiven this Dockerfile, point out potential security issues and propose fixes.Separate confirmed defects from policy choices and test the resulting image.

Documentation and runbooks

PatternExample promptCheck for
Service restartWrite a runbook for restarting PostgreSQL on Ubuntu 22.04 safely.Step-by-step checklist with commands and verification steps.
Incident responseDraft incident response steps for diagnosing an Nginx 502 Bad Gateway error.Check read-only evidence collection, stop conditions, and escalation.
DeploymentDocument the steps to roll out a new version of a containerized app using Kubernetes rolling updates.Check prerequisites, observation, rollback, and application-level verification.

Best practices

  • Provide operating system, tool, and service versions.
  • Request explanations, not only commands or configuration.
  • Request non-destructive checks before state changes.
  • Treat generated output as a draft and validate it before use.

Further reading