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

Dockerized Zabbix

From Zabbix.org
Jump to: navigation, search

Free test Dockbix instance

You may have your Dockbix instance. You just need free Docker ID and the browser. Zero Docker/Zabbix knowledge is required to start it. You will have full Admin permissions so that you may test anything there. You can even break it. See free test Dockbix instance.

Dockerized Zabbix - Dockbix XXL

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

Please visit Dockbix XXL project and read README for more details.

1) Start database container for Dockbix:

docker run \
   -d \
   --name dockbix-db \
   -v /etc/localtime:/etc/localtime:ro \
   --env="MARIADB_USER=zabbix" \
   --env="MARIADB_PASS=my_password" \
   monitoringartist/zabbix-db-mariadb

2) Start Dockbix container linked to the started DB container:

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

Wait for ~30 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 Dockbix initialisation:

docker logs dockbix

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 dockbix; docker rm -f dockbix-db;

Dockerized Zabbix Agent - Dockbix Agent XXL

Quick start - Zabbix agent with Docker/host/systemd/... metrics support:

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

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

Dockerized Zabbix Proxy - Dockbix XXL

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

Please visit Dockbix XXL project and read README for more details.

1) Start database container for Zabbix proxy:

docker run \
   -d \
   --name dockbix-db-proxy \
   -v /etc/localtime:/etc/localtime:ro \
   --env="MARIADB_USER=zabbix" \
   --env="MARIADB_PASS=my_password" \
   monitoringartist/zabbix-db-mariadb

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

docker run \
    -d \
    --name dockbix-proxy \
    -p 10051:10051 \
    -v /etc/localtime:/etc/localtime:ro \
    --link dockbix-db-proxy:dockbix-proxy.db \
    --env="ZP_DBHost=dockbix-proxy.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/dockbix-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/dockbix-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