Skip to content

Configuration

dev1lsconf edited this page Nov 28, 2026 · 1 revision

Configuración

TinyTop se configura por config.toml, variables de entorno y flags de CLI. La carga efectiva hace: defaults → archivo → overrides de entorno → normalización/validación.

CLI

tinytop --config /ruta/config.toml
tinytop --check-config --config /ruta/config.toml
tinytop --check-config --deep --config /ruta/config.toml
tinytop --tui --config /ruta/config.toml
tinytop --help
tinytop --version

--check-config --deep además abre/migra/pingea db_path.

Variables de entorno

Variable Descripción Default
TINYTOP_CONFIG Ruta al config config.toml
TINYTOP_BIND Dirección de escucha 0.0.0.0
TINYTOP_PORT Puerto HTTP 9090
TINYTOP_DB_PATH Ruta SQLite tinytop.db
TINYTOP_INTERVAL Intervalo de recolección (s) 30
TINYTOP_RETENTION_HOURS Retención (h) 168
TINYTOP_MAX_HISTORY_HOURS Máximo historial consultable (h) 168
TINYTOP_REQUEST_TIMEOUT_SECS Timeout de checks (s) 5
TINYTOP_AUTH_TOKEN Token de auth —
TINYTOP_AUTH_ALLOW_QUERY_TOKEN Permite ?token= (legacy, no recomendado) false

Ejemplo básico

bind = "0.0.0.0"
port = 9090
db_path = "tinytop.db"
interval_seconds = 30
retention_hours = 168
request_timeout_secs = 5
max_history_hours = 168

[[targets]]
name = "localhost"
url = "http://localhost:8080/actuator/health"
kind = "spring-boot"

[[targets]]
name = "api"
url = "http://localhost:3000/api/health"
kind = "generic"

Targets / checks

Campos comunes: name, check_type (http por defecto), url, kind, host, port, latency_warn_ms, cert_expiry_warn_days.

check_type Campos Notas
http/https url, kind opcional Integraciones compatibles (generic, spring-boot/actuator, quarkus, micrometer/prometheus, etc.)
tcp host, port Requiere host y puerto
ping host (o url/host) Best-effort: requiere ping en PATH
tls host, port Handshake + días de cert; best-effort: requiere openssl para expiración

Alertas

[alerts]
enabled = true
cpu_percent_warn = 90.0
mem_percent_warn = 90.0
disk_percent_warn = 90.0
target_latency_ms_warn = 1000.0
cert_expiry_days_warn = 14

Notificaciones

Opcionales y best-effort, enviadas en transiciones de alertas:

[notifications]
webhook_url = "https://hooks.example/..." # Discord compatible si es webhook de Discord
telegram_bot_token = "..."
telegram_chat_id = "..."
ntfy_url = "https://ntfy.sh"
ntfy_topic = "tinytop"
cooldown_secs = 300
notify_on_firing = true
notify_on_resolve = true

Los secretos/destinos se redactan en /api/config.

Autenticación

[auth]
token = "mi-token"              # Bearer / X-API-Key
# basic_user = "admin"
# basic_password = "secret"
allow_health_unauth = true
allow_query_token = false        # recomendado: no aceptar ?token=

Recomendado: Authorization: Bearer <token> o X-API-Key. ?token= puede filtrarse en historial/logs/referrers.

Clone this wiki locally