Created
October 2, 2019 20:53
-
-
Save isaqueprofeta/e95ad5aaf06db26b8268f0efdc2e4c16 to your computer and use it in GitHub Desktop.
Simple Zabbix Lab using official images (need to create some folder volumes and import zapix project from monitoringartist)
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
| version: '3' | |
| volumes: | |
| db_data: | |
| driver: local | |
| grafana_data: | |
| driver: local | |
| networks: | |
| app_net: | |
| ipam: | |
| driver: default | |
| config: | |
| - subnet: 172.25.0.0/24 | |
| services: | |
| zabbix-server: | |
| container_name: zabbix-server | |
| hostname: zabbix-server | |
| restart: unless-stopped | |
| image: zabbix/zabbix-server-pgsql:alpine-4.0-latest | |
| environment: | |
| - DB_SERVER_PORT=5432 | |
| - DB_SERVER_HOST=zabbix-db | |
| - POSTGRES_DB=zabbix | |
| - POSTGRES_USER=zabbix | |
| - POSTGRES_PASSWORD=zabbix | |
| ports: | |
| - '10051:10051' | |
| volumes: | |
| - ./zbx_env/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts:ro | |
| depends_on: | |
| - zabbix-db | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.10 | |
| zabbix-frontend: | |
| container_name: zabbix-frontend | |
| hostname: zabbix-frontend | |
| restart: unless-stopped | |
| image: zabbix/zabbix-web-apache-pgsql:alpine-4.0-latest | |
| environment: | |
| - DB_SERVER_PORT=5432 | |
| - DB_SERVER_HOST=zabbix-db | |
| - POSTGRES_DB=zabbix | |
| - POSTGRES_USER=zabbix | |
| - POSTGRES_PASSWORD=zabbix | |
| - PHP_TZ=America/Sao_Paulo | |
| - ZBX_SERVER_NAME=zabbix-server | |
| ports: | |
| - '80:80' | |
| - '443:443' | |
| volumes: | |
| - /etc/timezone:/etc/timezone:ro | |
| - /etc/localtime:/etc/localtime:ro | |
| - ./zbx_env/etc/ssl/apache2:/etc/ssl/apache2:ro | |
| depends_on: | |
| - zabbix-db | |
| - zabbix-server | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.12 | |
| zabbix-db: | |
| container_name: zabbix-db | |
| hostname: zabbix-db | |
| restart: unless-stopped | |
| image: postgres | |
| environment: | |
| - POSTGRES_DB=zabbix | |
| - POSTGRES_USER=zabbix | |
| - POSTGRES_PASSWORD=zabbix | |
| ports: | |
| - '5432:5432' | |
| volumes: | |
| - db_data:/var/lib/postgresql/data | |
| command: ["postgres", "-c", "max_connections=1000"] | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.11 | |
| zabbix-agent: | |
| container_name: zabbix-agent | |
| hostname: zabbix-agent | |
| restart: unless-stopped | |
| image: zabbix/zabbix-agent:alpine-4.0-latest | |
| environment: | |
| - ZBX_HOSTNAME=zabbix-agent | |
| - ZBX_DEBUGLEVEL=4 | |
| - ZBX_ENABLEREMOTECOMMANDS=1 | |
| - ZBX_SERVER_HOST=zabbix-server | |
| ports: | |
| - '10050:10050' | |
| volumes: | |
| - /etc/timezone:/etc/timezone:ro | |
| - /etc/localtime:/etc/localtime:ro | |
| - ./zbx_env/etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d:ro | |
| depends_on: | |
| - zabbix-server | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.13 | |
| zabbix-grafana: | |
| container_name: zabbix-grafana | |
| hostname: zabbix-grafana | |
| restart: unless-stopped | |
| image: monitoringartist/grafana-xxl:latest | |
| volumes: | |
| - grafana_data:/var/lib/grafana | |
| ports: | |
| - 3000:3000 | |
| depends_on: | |
| - zabbix-frontend | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.14 | |
| zabbix-zapix: | |
| container_name: zabbix-zapix | |
| hostname: zabbix-zapix | |
| restart: unless-stopped | |
| build: | |
| context: ./zapix | |
| ports: | |
| - '8080:80' | |
| depends_on: | |
| - zabbix-frontend | |
| networks: | |
| app_net: | |
| ipv4_address: 172.25.0.15 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extras to make the code work:
mkdir -p ./zbx_env/usr/lib/zabbix/externalscripts
mkdir -p ./zbx_env/etc/ssl/apache2
mkdir -p ./zbx_env/etc/zabbix/zabbix_agentd.d
git clone https://github.com/monitoringartist/zapix.git