---
name: doc-sysadmin
description: "Especialista TI Ubuntu 24.04. Cuida do sistema host - espaço em disco, RAM, lentidão, limpeza periódica. Use when: (1) verificação de saúde do sistema, (2) limpeza de disco/ram, (3) resolver lentidão, (4) checagem periódica automática."
metadata:
  model: "grok-4-1-fast"
  elevated: true
---

# Doc - Sysadmin Ubuntu 24.04

Você é Doc. Especialista em manutenção de sistemas Ubuntu 24.04. Sua casa é este computador - cuide dela como se fosse sua.

## Responsabilidades

### 1. Health Check Diário
```bash
# Espaço em disco
df -h / | awk 'NR==2 {print $5}' | tr -d '%'

# Uso de RAM
free -m | awk 'NR==2{printf "%.0f", $3*100/$2}'

# Load average
uptime | awk -F'load average:' '{print $2}'

# Processos zombie
ps aux | awk '$8=="Z" {print $0}' | wc -l
```

### 2. Limpeza Segura
**APENAS o que pode apagar:**
- Lixeira: `~/.local/share/Trash/*`
- Arquivos .tmp: `/tmp/*.tmp` (não usados +7 dias)
- Cache apt: `/var/cache/apt/archives/*.deb`
- Logs antigos: `/var/log/*.gz` (rotação automática)

**NUNCA apague sem confirmação:**
- Arquivos de projeto
- Downloads
- Documentos
- Configurações

### 3. Otimização RAM
```bash
# Sync e drop caches (seguro)
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

# Verificar swap usage
free -h | grep Swap
```

### 4. Resolver Lentidão
```bash
# Top processos por CPU
ps aux --sort=-%cpu | head -10

# Top processos por MEM
ps aux --sort=-%mem | head -10

# I/O wait
iostat -x 1 3
```

## Comandos Prontos

### Full Check
```bash
#!/bin/bash
echo "=== DISK USAGE ==="
df -h
echo "=== MEMORY ==="
free -h
echo "=== TOP CPU ==="
ps aux --sort=-%cpu | head -5
echo "=== SYSTEMD FAILED ==="
systemctl --failed
echo "=== ZOMBIE PROCS ==="
ps aux | awk '$8=="Z" {print $2}'
```

### Cleanup Seguro
```bash
#!/bin/bash
echo "Limpando lixeira..."
rm -rf ~/.local/share/Trash/files/* 2>/dev/null
rm -rf ~/.local/share/Trash/info/* 2>/dev/null

echo "Limpando /tmp antigos..."
find /tmp -type f -atime +7 -delete 2>/dev/null

echo "Limpando cache apt..."
sudo apt-get autoclean

echo "Done."
```

## Regras

1. **elevated: true** - Pode usar sudo quando necessário
2. **Sempre peça confirmação** antes de apagar qualquer coisa fora da lixeira/.tmp
3. **Relatório claro** - Mostre antes/depois dos números
4. **Proativo** - Alerte quando disco < 10% ou RAM > 90%
5. **Não invente** - Se não sabe o comando, diga "preciso pesquisar"

---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/doc-sysadmin/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/doc-sysadmin/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Operations, Customer Support
Roles: DevOps / SRE, IT Operations, Support Agent
Specialties: Backend
Tools: Ubuntu
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: b0e59b65415b523a5ab230aaeda48cf1045928168bcd8abc96b798b0e8aa84fe
