Created
March 6, 2019 10:03
-
-
Save mtrimarchi/d75f921308cf7e0882f87cc501faaa93 to your computer and use it in GitHub Desktop.
Setting up and running Zabbix along with Nginx and PostgreSql using Docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixed from example on blog post | |
# https://medium.com/@erbalvindersingh/setting-up-and-running-zabbix-along-with-nginx-and-postgresql-using-docker-compose-2b1f011b0ba6 | |
version: '3.1' | |
services: | |
postgres-server: # The Postgres Database Service | |
image: postgres:latest | |
restart: always | |
environment: # Username, password and database name variables | |
POSTGRES_USER: zabbix | |
POSTGRES_PASSWORD: zabbix | |
POSTGRES_DB: zabbix | |
PG_DATA: /var/lib/postgresql/data/pgdata #data storage | |
zabbix-server: # The main Zabbix Server Software Service | |
image: zabbix/zabbix-server-pgsql:ubuntu-latest | |
restart: always | |
environment: # The Postgres database value variable | |
POSTGRES_USER: zabbix | |
POSTGRES_PASSWORD: zabbix | |
POSTGRES_DB: zabbix | |
ZBX_HISTORYSTORAGETYPES: log,text #Zabbix configuration variables | |
ZBX_DEBUGLEVEL: 1 | |
ZBX_HOUSEKEEPINGFREQUENCY: 1 | |
ZBX_MAXHOUSEKEEPERDELETE: 5000 | |
depends_on: | |
- postgres-server | |
volumes: # Volumes for scripts and related files you can add | |
- /usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts | |
zabbix-web: # The main Zabbix web UI or interface | |
image: zabbix/zabbix-web-nginx-pgsql:ubuntu-latest | |
restart: always | |
environment: # Postgre database variables | |
POSTGRES_USER: zabbix | |
POSTGRES_PASSWORD: zabbix | |
POSTGRES_DB: zabbix | |
ZBX_SERVER_HOST: zabbix-server # Zabbix related and Php variables | |
ZBX_POSTMAXSIZE: 64M | |
PHP_TZ: "Europe/Rome" | |
ZBX_MAXEXECUTIONTIME: 500 | |
depends_on: | |
- postgres-server | |
- zabbix-server | |
ports: # Port where Zabbix UI is available | |
- 8090:80 | |
zabbix-agent: # Zabbix agent service that tracks usage and send to zabbix server | |
image: zabbix/zabbix-agent:latest | |
privileged: true #access mode for allowing resource access | |
network_mode: "host" | |
restart: unless-stopped | |
environment: | |
- ZBX_SERVER_HOST=127.0.0.1 #the IP/Dns of Zabbix server | |
adminer: #Optional for accessing databases | |
image: adminer | |
restart: always | |
ports: | |
- 8080:8080 | |
grafana-xxl: #optional more functional and creative UI | |
image: monitoringartist/grafana-xxl:latest | |
ports: | |
- 3000:3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment