Fork me on GitHub

Project Notes

Zabbix 5 Docker

Running Zabbix 5 with Docker

Notes

Multiple docker images are available for Zabbix to suit a range of deployment topologies.

The old all-in-one zabbix-appliance image, which was ideal for local testing, is no longer updated for version 5. It is now necessary to orchestrate multiple containers even for a simple test setup. This describes the simplest-possible-way (that I know of so far).

Required Docker Images

For a minimal deployment with MySQL database storage:

  • Zabbix agent - zabbix/zabbix-agent
  • Zabbix server with MySQL database support - zabbix/zabbix-server-mysql
  • Zabbix web-interface based on Apache2 web server with MySQL database support - zabbix/zabbix-web-apache-mysql
  • mysql:8.0

Alternative/additional images not used:

  • Zabbix server with PostgreSQL database support - zabbix/zabbix-server-pgsql
  • Zabbix web-interface based on Apache2 web server with PostgreSQL database support - zabbix/zabbix-web-apache-pgsql
  • Zabbix web-interface based on Nginx web server with PostgreSQL database support - zabbix/zabbix-web-nginx-pgsql
  • Zabbix web-interface based on Nginx web server with MySQL database support - zabbix/zabbix-web-nginx-mysql
  • Zabbix agent 2 - zabbix/zabbix-agent2
  • Zabbix proxy with SQLite3 database support - zabbix/zabbix-proxy-sqlite3
  • Zabbix proxy with MySQL database support - zabbix/zabbix-proxy-mysql
  • Zabbix Java Gateway - zabbix/zabbix-java-gateway
  • SNMP trap support - zabbix/zabbix-snmptraps

Running the Zabbix Appliance

The docker-compose.yml is setup for running Zabbix appliance with MySQL data persisted in a volume.

It also starts a separate zabbix agent container that can monitor the zabbix appliance container itself. The agent container is linked the the server container so that the agent can perform active checks.

$ docker-compose up -d

On first startup, the web interface will be available on 0.0.0.0:8081 with default credentials Admin/zabbix

initial_dashboard

$ $ docker ps
CONTAINER ID        IMAGE                                              COMMAND                  CREATED             STATUS                   PORTS                              NAMES
5eccf809e066        zabbix/zabbix-web-apache-mysql:alpine-5.4-latest   "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes (healthy)   8443/tcp, 0.0.0.0:8081->8080/tcp   dockerized5_zabbix-web-apache-mysql_1
40a35deab67c        zabbix/zabbix-server-mysql:alpine-5.4-latest       "/sbin/tini -- /usr/…"   2 minutes ago       Up 2 minutes             0.0.0.0:10051->10051/tcp           dockerized5_zabbix-server_1
6e8570399d81        mysql:8.0                                          "docker-entrypoint.s…"   2 minutes ago       Up 2 minutes                                                dockerized5_mysql-server_1
1e64f8a45ac8        zabbix/zabbix-agent:alpine-5.4-latest              "/sbin/tini -- /usr/…"   2 minutes ago       Up 2 minutes                                                dockerized5_zabbix-agent_1

The agent hostname needed to be updated in order to find the agent container at zabbix-agent:10050:

agent_configured

Now we have basic monitoring of the zabbix server via the zabbix agent:

updated_dashboard

zabbix_server_activity

Shutting down and checking volumes

$ docker-compose down
$ docker volume ls | grep zabbix5
local               dockerized5_zabbix5-db

The zabbix_control.sh wraps up some simple commands to start and stop the containers, get logs and open a shell.

Credits and References

About LCK#193 infrastructurezabbixmonitoringdocker
Project Source on GitHub Return to the Project Catalog

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.