I currently have my Zabbix server running on a NUC, but I was wanting to install it on my truenas server so everything is centralized. I’ve started trying to install it, but it’s looking like it may be a bigger headache than it’s worth. I was able to get it working successfully using portainer, but I really want it in my apps list. I know this is probably a dumb thing to be doing, but I thought it would be cool. My issue is, I have the potgresql installed as a custom app , but the zabbix server custom app just shows PostgreSQL server is not available. Waiting 5 seconds.
The postgresql shows the database is ready for connections
If you have it working in portainer, why not just copy that compose and it use it as a custom yaml app in the Scale UI?
Also assuming you are running Scale 24.10.
That does work, but it doesn’t allow for adding in the portal config for the web UI button in the apps menu. If anyone knows how to add that to my yaml I will be set.
I tried adding PORTAL_HTTP_PORT: 8080 in the environment for the zabbix frontend, but it didn’t do anything
Nevermind I found a thread explaining how to do this.
Thanks for the help! I’m up and running now
Here is my yaml in case anyone else wants to do this. You will just need to replace testdb, testpassword, and testuser in the 3 different spots.
services:
postgresql-server:
container_name: postgresql-server
environment:
POSTGRES_DB: testdb
POSTGRES_PASSWORD: testpassword
POSTGRES_USER: testuser
image: postgres:latest
restart: unless-stopped
volumes:
- postgresql-data:/var/lib/postgresql/data
zabbix-agent2:
container_name: zabbix-agent2
depends_on:
- zabbix-server
environment:
ZBX_HOSTNAME: zabbix-server
ZBX_SERVER_ACTIVE: zabbix-server
ZBX_SERVER_HOST: zabbix-server
ZBX_SERVER_PORT: ‘10051’
image: zabbix/zabbix-agent2:latest
privileged: True
restart: unless-stopped
volumes:
- /:/rootfs:ro
- /var/run:/var/run
zabbix-server:
container_name: zabbix-server
depends_on:
- postgresql-server
environment:
DB_SERVER_HOST: postgresql-server
POSTGRES_DB: testdb
POSTGRES_PASSWORD: testpassword
POSTGRES_USER: testuser
ZBX_SERVER_HOST: zabbix-server
image: zabbix/zabbix-server-pgsql:latest
ports:
- ‘10051:10051’
restart: unless-stopped
volumes:
- zabbix-server-data:/var/lib/zabbix
- zabbix-snmptraps-data:/var/lib/zabbix/snmptraps
- zabbix-export-data:/var/lib/zabbix/export
zabbix-web-nginx-pgsql:
container_name: zabbix-web
depends_on:
- postgresql-server
- zabbix-server
environment:
DB_SERVER_HOST: postgresql-server
PHP_TZ: America/New_York
POSTGRES_DB: testdb
POSTGRES_PASSWORD: testpassword
POSTGRES_USER: testuser
ZBX_SERVER_HOST: zabbix-server
image: zabbix/zabbix-web-nginx-pgsql:latest
ports:
- ‘8080:8080’
restart: unless-stopped
volumes:
- zabbix-web-data:/usr/share/zabbix
version: ‘3.7’
volumes:
postgresql-data: Null
zabbix-export-data: Null
zabbix-server-data: Null
zabbix-snmptraps-data: Null
zabbix-web-data: Null
x-portals:
- host: “host IP”
name: Web UI
path: /
port: 8080
scheme: http
In case somebody want’s to deploy ZABBIX directly from dockge
# Datasets tree:
# dockge
# stack <---- dataset dedicated for dockge Stacks Storage
# zabbix ... <---- created from dockge for a stack named 'zabbix'
# corresponding to '.' in the Composer's volumes
# Variable:
SQL_PASSWORD= ... ...
The Composer YAML:
services:
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
PUID: 568
PGID: 568
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: ${SQL_PASSWORD}
POSTGRES_DB: zabbix
volumes:
- ./zabbix_db:/var/lib/postgresql/data
zabbix-server:
image: zabbix/zabbix-server-pgsql:alpine-7.4-latest
restart: unless-stopped
environment:
PUID: 568
PGID: 568
DB_SERVER_HOST: postgres
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: ${SQL_PASSWORD}
POSTGRES_DB: zabbix
ports:
- 10051:10051
depends_on:
- postgres
zabbix-web:
image: zabbix/zabbix-web-nginx-pgsql:alpine-7.4-latest
restart: unless-stopped
environment:
PUID: 568
PGID: 568
DB_SERVER_HOST: postgres
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: ${SQL_PASSWORD}
POSTGRES_D8: zabbix
ZBX_SERVER_HOST: zabbix-server
PHP_TZ: America/Montreal
ports:
- 8090:8080
depends_on:
- postgres
- zabbix-server
zabbix-agent:
image: zabbix/zabbix-agent:alpine-7.4-latest
restart: unless-stopped
environment:
PUID: 0
PGID: 0
ZBX_HOSTNAME: "zabbix-server"
ZBX_SERVER_HOST: zabbix-server
ZBX_SERVER_PORT: '10051'
ZBX_SERVER_ACTIVE: zabbix-server
privileged: true
depends_on:
- zabbix-server
volumes:
- /:/rootfs:ro
- /var/run:/var/run
Cheers