5c213972b6
Lightweight telemetry agent (stdlib-only, Python 3.8+) that collects
metrics via pre-defined widget types and pushes to POST /api/company/metrics.
Widget types: system_cpu, system_memory, system_disk, http_check,
port_check, process_check, custom_cmd
Platform: Linux (fully). Windows collectors stubbed (NOT_IMPL markers)
ready for porting without changing call sites. system_disk / http_check /
port_check / custom_cmd already cross-platform.
Delivery: run directly (python3 ethica-agent.py --config ethica-agent.yml),
as a systemd service (ethica-agent.service), or as a Docker container.
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
# Ethica Agent configuration
|
|
# Get your token from the admin panel: Company → API tab → Company token
|
|
|
|
token: REPLACE_ME
|
|
home: https://ethica.no
|
|
interval: 60 # seconds between collection runs
|
|
|
|
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
|