See www.zabbix.com for the official Zabbix site.

Dockerized Zabbix

From Zabbix.org
Jump to: navigation, search

Dockerized Zabbix Server XXL

This is only for testing, DB data are not stored in persistent storage - not for production!!!

Please visit Zabbix XXL Docker project (Zabbix 3.0/3.2) and read README for more details.

1) Start database container for Zabbix server:

docker run \
    -d \
    --name zabbix-db \
    --env="MARIADB_USER=zabbix" \
    --env="MARIADB_PASS=my_password" \
    monitoringartist/zabbix-db-mariadb

You can check logs during DB initialization:

 docker logs zabbix-db

2) Start Zabbix server container linked to the started DB container:

docker run \
    -d \
    --name zabbix \
    -p 80:80 \
    -p 10051:10051 \
    -v /etc/localtime:/etc/localtime:ro \
    --link zabbix-db:zabbix.db \
    --env="ZS_DBHost=zabbix.db" \
    --env="ZS_DBUser=zabbix" \
    --env="ZS_DBPassword=my_password" \
    --env="XXL_zapix=true" \
    --env="XXL_grapher=true" \
    monitoringartist/zabbix-xxl:latest

Again wait for ~60 seconds and then your Zabbix web frontend will be available on port 80 (http://<IP of your docker host>/) - default credentials: Admin/zabbix and Zabbix server on port 10051.

You can check logs as well during the Zabbix initialization:

docker logs zabbix

If port 80 is occupied, then you can expose Zabbix web frontend on a different port, edit -p parameter:

-p <free port number>:80

Stop and remove the container after testing:

docker rm -f zabbix; docker rm -f zabbix-db;

Dockerized Zabbix Agent

Quick start - Zabbix agent with Docker metrics and OS Linux metrics support:

docker run \
 --name=dockbix-agent-xxl \
 --net=host \
 --privileged \
 -v /:/rootfs \
 -v /var/run:/var/run \
 -e "ZA_Server=<ZABBIX SERVER IP/DNS NAME>" \
 -e "ZA_ServerActive=<ZABBIX SERVER IP/DNS NAME>" \
 -d monitoringartist/dockbix-agent-xxl-limited:latest

Please visit Docbix Agent XXL Docker project and read README for more details.

Dockerized Zabbix Proxy XXL

This is only for testing, DB data are not stored in persistent storage - not for production!!!

Please visit Zabbix Community Docker project and read README for more details.


1) Start database container for Zabbix proxy:

docker run \
    -d \
    --name zabbix-db-proxy \
    --env="MARIADB_USER=zabbix" \
    --env="MARIADB_PASS=my_password" \
    monitoringartist/zabbix-db-mariadb

Wait for 60 seconds for DB initialization, you can check logs during the initialization:

 docker logs zabbix-db-proxy

2) Start Zabbix proxy container linked to the started proxy DB container:

docker run \
    -d \
    --name zabbix-proxy \
    -p 10051:10051 \
    -v /etc/localtime:/etc/localtime:ro \
    --link zabbix-db-proxy:zabbix.db \
    --env="ZP_DBHost=zabbix.db" \
    --env="ZP_DBUser=zabbix" \
    --env="ZP_DBPassword=my_password" \
    --env="ZP_Server=<ZABBIX SERVER IP/DNS NAME>" \
    --env="ZP_enabled=true" \
    --env="ZA_enabled=false" \
    --env="ZW_enabled=false" \
    --env="ZS_enabled=false" \
    monitoringartist/zabbix-xxl:latest

Monitoring of Docker containers

The solution for Docker container monitoring - most often used Zabbix C Docker module/template.

Dockerized Grafana with Zabbix datasource

If you use Dockerized Zabbix, then also Grafana with Zabbix datasource is recommended. Use Grafana XXL project:

# create /var/lib/grafana as persistent volume storage
docker run -d -v /var/lib/grafana --name grafana-xxl-storage busybox:latest

# start grafana-xxl
docker run \
  -d \
  -p 3000:3000 \
  --name grafana-xxl \
  --volumes-from grafana-xxl-storage \
  monitoringartist/grafana-xxl:latest

Then configure your Zabbix datasource in Grafana - see Grafana-Zabbix documentation.

Available extensions for Dockerized Zabbix

Zabbix XXL all templates

200+ community templates from Zabbix Community Repos - programmatically verified template compatibility with Zabbix 3.0.

1.) Start Docker storage all-template container:

docker run \
   -d \
   --name zabbix-ext-all-templates \
   monitoringartist/zabbix-ext-all-templates:latest

2.) Use volumes from the all-template container in zabbix-server container:

--volumes-from zabbix-ext-all-templates \

For example:

docker run \
   -d \
   --name zabbix \
   -p 80:80 \
   -p 10051:10051 \
   -v /etc/localtime:/etc/localtime:ro \
   --volumes-from zabbix-ext-all-templates \
   --link zabbix-db:zabbix.db \
   --env="ZS_DBHost=zabbix.db" \
   --env="ZS_DBUser=zabbix" \
   --env="ZS_DBPassword=my_password" \
   --env="XXL_zapix=true" \
   --env="XXL_grapher=true" \
   --env="XXL_apiuser=Admin" \
   --env="XXL_apipass=zabbix" \
   monitoringartist/zabbix-xxl:latest

Orchestration support of Dockerized Zabbix

Zabbix on Kubernetes - https://github.com/monitoringartist/kubernetes-zabbix

Template for Zenoss Control Center - https://github.com/monitoringartist/control-center-zabbix

Use cases

Dockerized Zabbix on Synology:

Synology-zabbix-docker.png