Fork me on GitHub

Project Notes

#111 Docker

Running Zabbix with Docker

Notes

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

The Zabbix Appliance image is the basic all-in-one, good for local testing.

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:80 with default credentials Admin/zabbix

initial_dashboard

$ docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                                                   NAMES
251884f1a063        zabbix/zabbix-appliance:latest   "/sbin/tini -- /usr/…"   5 minutes ago       Up 5 minutes        0.0.0.0:80->80/tcp, 0.0.0.0:10051->10051/tcp, 443/tcp   dockerized_zabbix-app_1
2083160a135f        zabbix/zabbix-agent:latest       "/sbin/tini -- /usr/…"   5 minutes ago       Up 5 minutes        10050/tcp                                               dockerized_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 zapp
local               dockerized_zapp-db

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

Credits and References

About LCK#111 infrastructurezabbixmonitoringdocker

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

Project Source on GitHub Return to the LittleCodingKata Catalog
About LittleCodingKata

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.

Follow the Blog follow projects and notes as they are published in your favourite feed reader