Add Zabbix API token authentication support

ZABBIX_API_TOKEN env var can now be used instead of ZABBIX_USER +
ZABBIX_PASSWORD. When set, the token is passed directly as the auth
value in JSON-RPC calls and no login/logout session is created.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-17 10:07:41 +02:00
parent 7d18f20bf1
commit 2695379589
3 changed files with 14 additions and 4 deletions

View File

@@ -28,8 +28,11 @@ services:
# ── Zabbix API (optional) ─────────────────────────────────────────────
# Leave ZABBIX_URL empty to disable automatic host management.
# Requires Zabbix 6.0+.
ZABBIX_URL: "https://monitor.stranto.com" # e.g. "http://zabbix.example.com"
# Requires Zabbix 5.4+.
ZABBIX_URL: "https://monitor.stranto.com"
# Use an API token (preferred) OR user + password — not both.
# Create token in Zabbix: Administration → API tokens → Create API token
ZABBIX_API_TOKEN: ""
ZABBIX_USER: "odmon"
ZABBIX_PASSWORD: "lk09u834ojnaslvnjh09u34g"
ZABBIX_HOST_GROUP: "Yodeck Players"