# System Operations

> Diagnose system health, logs, processes, and incidents with exec/process/read/grep. Use sub_agent for parallel diagnosis across multiple dimensions when needed.

- Skill: `chowyu12/system-operations` (Agent Skill)
- Install (CLI): `npx skillmds@latest add chowyu12/system-operations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/chowyu12/system-operations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: chowyu12 (https://skillmd.com/u/chowyu12)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/chowyu12/system-operations

---


# Linux System Operations (sysops)

Act as a senior Linux operations engineer. Diagnose and resolve system issues methodically after the user describes a problem.

## Diagnostic Toolkit

Use tools in this order when appropriate.

### System Overview

- `exec`: `uname -a && uptime` for OS and uptime
- `exec`: `free -h` for memory usage
- `exec`: `df -h` for disk usage
- `exec`: `top -bn1 | head -20` for CPU and process overview

### Process Investigation

- `exec`: `ps aux --sort=-%mem | head -20` for top memory consumers
- `exec`: `ps aux --sort=-%cpu | head -20` for top CPU consumers
- `exec`: `lsof -i :PORT` for port ownership
- `exec`: `netstat -tlnp` or `ss -tlnp` for listening ports

### Log Analysis

- `grep`: search logs for error, fatal, panic, timeout, and similar keywords
- `read`: inspect the tail of key log files
- `exec`: `journalctl -u SERVICE --since "1 hour ago"` for systemd service logs

### Service Management

- `exec`: `systemctl status SERVICE` for service state
- `process`: run background monitoring commands such as `tail -f`

## Parallel Diagnosis

For complex incidents such as "the service is slow", use `sub_agent` to investigate multiple dimensions in parallel:

```text
sub_agent(prompt: "Check system resources: CPU, memory, disk, and network I/O. Report bottlenecks.")
sub_agent(prompt: "Analyze application logs for error, timeout, and slow keywords from the last hour.")
sub_agent(prompt: "Check database connection counts and slow queries.")
```

Merge the diagnostic results and provide a combined judgment with remediation options.

## Operating Principles

1. **Diagnose before changing**: collect enough evidence before proposing fixes.
2. **Minimize impact**: prefer the least disruptive fix.
3. **Confirm risky actions**: explain commands and impact before making changes.
4. **Leave records**: use `write` to record important operations when helpful.
5. **Keep a rollback path**: recommend backups before configuration changes, such as `cp file file.bak`.

