-
Notifications
You must be signed in to change notification settings - Fork 31
/
zabbix.yml
110 lines (105 loc) · 3.13 KB
/
zabbix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Maintainer: Mickael "PAPAMICA" Asseline
# Update: 2022-05-11
#& type: 3
#& title: Zabbix
#& description: Best monitoring tools
#& note: Website: <a href='https://www.zabbix.com/' target='_blank' rel='noopener'>Zabbix.com</a>
#& categories: SelfHosted, Monitoring, PAPAMICA
#& platform: linux
#& logo: https://img.papamica.com/logo/zabbix.png
#% SERVICE: Name of the service (No spaces or points) [zabbix]
#% DATA_LOCATION: data localization (Example: /apps/service) [/_data/apps]
#% URL: Service URL (Example: service.papamica.fr or service.com)
#% NETWORK: Your Traefik network (Example: proxy) [proxy]
#% DB_USER: Database user (No spaces or points) [zabbix]
#% DB_PASSWORD: Database user password
#% TIME_ZONE: Time zone (Example : Europe/Paris) [Europe/Paris]
# Work with Portainer
version: '2'
services:
postgres-server:
image: postgres:14.2
restart: always
container_name: $SERVICE-db
environment:
POSTGRES_USER: $DB_USER
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: zabbix
PG_DATA: /var/lib/postgresql/data/pgdata
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $DB_USER"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- $DATA_LOCATION/$SERVICE/db:/var/lib/postgresql/data
labels:
- "autoupdate=monitor"
networks:
- default
zabbix-server:
image: zabbix/zabbix-server-pgsql:6.0.2-ubuntu
restart: always
container_name: $SERVICE-server
environment:
POSTGRES_USER: $DB_USER
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: zabbix
ZBX_HISTORYSTORAGETYPES: log,text
ZBX_DEBUGLEVEL: 1
ZBX_HOUSEKEEPINGFREQUENCY: 1
ZBX_MAXHOUSEKEEPERDELETE: 5000
ZBX_STARTVMWARECOLLECTORS: 10
ZBX_VMWAREFREQUENCY: 30
ZBX_VMWAREPERFFREQUENCY: 30
ZBX_VMWARECACHESIZE: 16M
ZBX_VMWARETIMEOUT: 10
ZBX_CACHESIZE: 2G
healthcheck:
test: grep -qr "zabbix_server" /proc/*/status || exit 1
interval: 1m
timeout: 30s
retries: 3
depends_on:
- postgres-server
labels:
- "autoupdate=monitor"
ports:
- 10051:10051
volumes:
- $DATA_LOCATION/$SERVICE/alertscripts:/usr/lib/zabbix/alertscripts
networks:
- default
zabbix-web:
image: zabbix/zabbix-web-nginx-pgsql:6.0.2-ubuntu
restart: always
container_name: $SERVICE-web
environment:
POSTGRES_USER: $DB_USER
POSTGRES_PASSWORD: $DB_PASSWORD
POSTGRES_DB: zabbix
ZBX_SERVER_HOST: $SERVICE-server
ZBX_POSTMAXSIZE: 64M
PHP_TZ: $TIME_ZONE
ZBX_MAXEXECUTIONTIME: 500
healthcheck:
test: curl --fail http://localhost:8080 || exit 1
interval: 1m
timeout: 30s
retries: 3
depends_on:
- postgres-server
- zabbix-server
networks:
- default
labels:
- "autoupdate=monitor"
- "traefik.enable=true"
- "traefik.http.routers.zabbix-secure.rule=Host(`$URL`)"
- "traefik.http.routers.zabbix-secure.tls.certresolver=http"
- "traefik.http.services.zabbix-secure.loadbalancer.server.port=8080"
- "traefik.docker.network=$NETWORK"
networks:
default:
external:
name: $NETWORK