Table of Contents
Zabbix
Monitoring stack — Zabbix 7.4 with PostgreSQL backend, Apache web frontend, and two agents.
Stack
| Component | Image |
|---|---|
| Zabbix Server | zabbix/zabbix-server-pgsql:ubuntu-7.4-latest |
| Web Frontend | zabbix/zabbix-web-apache-pgsql:ubuntu-7.4-latest |
| Agent (container) | zabbix/zabbix-agent:ubuntu-7.4-latest |
| Database | postgres:16-alpine |
Access
- URL: https://zb.alogins.net (Caddy → localhost:81)
Agents
Three agents are configured:
| Agent | Type | Hostname | IP | Monitors |
|---|---|---|---|---|
zabbix-agent2 |
systemd on host | AgapHost |
local | Docker host (physical server) |
zabbix-agent container |
Docker Compose | Zabbix server |
local | Zabbix server container |
zabbix-agent2 |
systemd on remote | juris |
83.99.190.32 |
Juris remote server |
The Juris agent uses active mode only — connects outbound to zb.alogins.net:10051, no inbound ports required.
The host agent (zabbix-agent2) connects to 127.0.0.1:10051 (Zabbix server exposed port).
The container agent connects to zabbix-server over the internal backend Docker network. The "Zabbix server" host in Zabbix uses interface DNS zabbix-agent for passive checks.
Config
Directory: agap_git/zabbix/
.env variables:
| Variable | Description |
|---|---|
WEB_PORT |
Host port for web frontend (81) |
PHP_TZ |
Timezone for PHP/web |
AGENT_HOSTNAME |
Hostname for Docker container agent (Zabbix server) |
POSTGRES_DATA_DIR |
PostgreSQL data path (/mnt/ssd/dbs/zabbix) |
POSTGRES_USER |
DB username |
POSTGRES_PASSWORD |
DB password |
POSTGRES_DB |
DB name |
Start
cd agap_git/zabbix
docker compose up -d
HA Trapper Items
Host "HA Agap" receives alerts from Home Assistant via history.push API.
| Item Key | Type | Trigger | Severity |
|---|---|---|---|
water.leak |
Text trapper | last() <> "ok" → "Water leak detected in {room}" |
Disaster |
To add a new HA alert: create a trapper item + trigger on "HA Agap", add rest_command in HA configuration.yaml, create HA automation to call it.
GPU Monitoring (AgapHost)
The host agent monitors the GTX 1070 GPU via the zabbix-agent2-plugin-nvidia-gpu package.
Installed packages:
apt install zabbix-agent2-plugin-nvidia-gpu
Plugin binary: /usr/libexec/zabbix/zabbix-agent2-plugin-nvidia-gpu
Plugin config: /etc/zabbix/zabbix_agent2.d/plugins.d/nvidia.conf
Template linked to AgapHost: Nvidia by Zabbix agent 2 active — uses nvml.* keys.
Key metrics reported:
| Item | Key |
|---|---|
| GPU memory free | nvml.device.memory.fb.free |
| GPU memory used | nvml.device.memory.fb.used |
| GPU utilization | nvml.device.utilization.gpu |
| Temperature | nvml.device.temperature |
| Power usage | nvml.device.power.usage |
ECC memory error items show expected errors — GTX 1070 does not support ECC.
Notes
- Zabbix server port 10051 is exposed on the host for the host agent
- Backend and database networks are internal (not exposed)
- Container agent uses both active and passive check modes