94e79becd8
- Agent sends group name (defaults to hostname) and richer metric notes (memory/disk include absolute GB values; CPU note includes system uptime) - push() accepts group param; server stores it as agent_group on deployments - Upsert key is now (company_id, agent_group, name) so two agents on the same company but different servers don't overwrite each other's CPU/Memory - Add widget config packs: linux-base, web-nginx, database-postgres/redis, docker-host, custom-cmd examples
75 lines
2.6 KiB
YAML
75 lines
2.6 KiB
YAML
# Ethica Agent configuration
|
|
#
|
|
# Token (required): set via ETHICA_TOKEN env var (recommended) or here.
|
|
# Get it from: admin panel → Company → API tab → Company token
|
|
#
|
|
# token: REPLACE_ME ← or set ETHICA_TOKEN in .env / environment
|
|
# home: https://ethica.no ← or set ETHICA_HOME (default: https://ethica.no)
|
|
# interval: 60 ← or set ETHICA_INTERVAL (seconds, default: 60)
|
|
# group: my-server ← or set ETHICA_GROUP (default: system hostname)
|
|
# All metrics from this agent are grouped under this
|
|
# name in the Ethica dashboard (shows as a server card).
|
|
|
|
group: my-server
|
|
interval: 60
|
|
|
|
widgets:
|
|
|
|
# ── Server metrics ────────────────────────────────────────────────────────
|
|
- type: system_cpu
|
|
name: CPU
|
|
degrade_threshold: 80 # % → degraded
|
|
offline_threshold: 95 # % → offline
|
|
|
|
- type: system_memory
|
|
name: Memory
|
|
degrade_threshold: 85
|
|
offline_threshold: 97
|
|
|
|
- type: system_disk
|
|
name: Disk /
|
|
path: /
|
|
degrade_threshold: 80
|
|
offline_threshold: 95
|
|
|
|
# Multiple disks:
|
|
# - type: system_disk
|
|
# name: Disk /data
|
|
# path: /data
|
|
# degrade_threshold: 85
|
|
# offline_threshold: 95
|
|
|
|
# ── HTTP endpoint checks ──────────────────────────────────────────────────
|
|
- type: http_check
|
|
name: My Application
|
|
url: https://myapp.example.com
|
|
timeout: 10 # seconds
|
|
|
|
# ── Port / TCP checks ─────────────────────────────────────────────────────
|
|
- type: port_check
|
|
name: Database
|
|
host: localhost
|
|
port: 5432
|
|
timeout: 5
|
|
|
|
- type: port_check
|
|
name: Redis
|
|
host: localhost
|
|
port: 6379
|
|
|
|
# ── Process checks ────────────────────────────────────────────────────────
|
|
- type: process_check
|
|
name: nginx
|
|
process: nginx
|
|
|
|
- type: process_check
|
|
name: Postgres
|
|
process: postgres
|
|
|
|
# ── Custom check (shell command) ──────────────────────────────────────────
|
|
# Exit code convention: 0 = online, 1 = degraded, anything else = offline
|
|
# - type: custom_cmd
|
|
# name: My health check
|
|
# cmd: /opt/checks/my-check.sh
|
|
# timeout: 30
|