--- name: daily-report description: > Genera y envia un reporte diario con metricas de servicios, estado de salud, incidentes recientes y tareas pendientes. Puede enviarse via Matrix a un room especifico o guardarse como archivo. --- # Daily Report Skill Esta skill genera reportes diarios automaticos consolidando informacion de multiples fuentes. ## Proposito - Proveer visibilidad diaria del estado de servicios - Consolidar metricas de diferentes fuentes - Alertar sobre anomalias o degradacion - Tracking de incidentes y resoluciones ## Fuentes de datos El reporte puede incluir datos de: - Estado de servicios (via SSH + systemctl) - Metricas HTTP (via health endpoints) - Analisis de logs (via log-analyzer skill) - Uso de recursos (CPU, memoria, disco via SSH) - Incidentes recientes (desde base de datos o API) ## Estructura del reporte ```markdown # Daily Report - ## Services Status | Service | Host | Status | Uptime | |---------|------|--------|--------| | myapp | prod-01 | running | 15d 3h | | worker | prod-02 | running | 2d 8h | ## Health Metrics - Total requests: - Error rate: % - Avg response time: ms - P99 latency: ms ## Incidents - [RESOLVED] Database connection timeout - 14:30 - Fixed by restarting pool - [OPEN] High memory usage on worker - Since 18:00 ## Warnings - Service X disk usage: 85% - Service Y error rate: 3.2% (threshold: 2%) ## System Resources | Host | CPU | Memory | Disk | |------|-----|--------|------| | prod-01 | 45% | 62% | 71% | | prod-02 | 23% | 48% | 55% | ## Recommendations - Investigate memory leak in worker service - Plan disk cleanup on prod-01 --- Generated by at ``` ## Proceso de generacion ### 1. Recopilar datos de servicios Para cada servicio configurado: ```bash systemctl status --no-pager ``` Extrae: estado, uptime, ultimos logs ### 2. Verificar health endpoints Si el servicio expone /health o /metrics: ```bash http_get http://:/health ``` ### 3. Analizar logs recientes Usa `log-analyzer` skill para cada servicio: - Ultimas 24h de logs - Conteo de errores/warnings - Errores criticos ### 4. Obtener metricas de sistema ```bash # CPU y memoria top -bn1 | head -20 # Disco df -h ``` ### 5. Consolidar y formatear - Genera el markdown del reporte - Aplica template si existe (templates/daily-report.md) - Incluye timestamp y firma del agente ### 6. Enviar reporte Opciones: - Enviar a Matrix room (via send_message) - Guardar como archivo (via file_write) - Enviar via email (si hay tool de email) ## Configuracion El agente debe tener configurado: - Lista de servicios a monitorear - Hosts donde corren - Health endpoints (opcional) - Destination room o file path para el reporte Ejemplo de config (en el agent config YAML): ```yaml daily_report: services: - name: myapp host: prod-01 health_url: http://localhost:8080/health - name: worker host: prod-02 destination: type: matrix room_id: "!reportroom:matrix.org" schedule: "0 9 * * *" # 9am diario ``` ## Parametros Parametros opcionales al ejecutar manualmente: - `date`: fecha del reporte (default: today) - `services`: lista de servicios a incluir (default: todos configurados) - `destination`: override del destino (room_id o file_path) - `include_recommendations`: true/false (default: true) ## Ejemplo de uso Usuario: "Genera el reporte diario" Agente: 1. skill_search("daily report") 2. skill_load("daily-report") 3. Recopilar datos de todos los servicios configurados 4. Generar markdown del reporte 5. Enviar al room configurado o mostrar al usuario ## Automatizacion Esta skill esta disenada para ejecutarse via cron. Ver `crons/daily-report/` para la configuracion de la automatizacion.