Docker Zabbix

Add and monitor running docker containers in Zabbix Server
Alternatives To Docker Zabbix
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Zabbix Docker1,821
20 hours ago4gpl-2.0Shell
Official Zabbix Dockerfiles
Zabbix Threat Control187
21 days ago27gpl-3.0Python
Zabbix vulnerability assessment plugin
Ansible Zabbix Server159
3 years ago5mitPython
Installing and maintaining zabbix-server for RedHat/Debian/Ubuntu.
Quick Installation Zabbix137
4 months ago1Shell
一键安装 zabbix 3.0.22 zabbix install
Zabbix92
5 years ago43apache-2.0Ruby
Zabbix chef cookbook
Puppet Zabbix79215 days ago32May 07, 2021115apache-2.0Puppet
Puppet module for creating and maintaining zabbix components with puppet.
Zabbixweb73
3 years ago6mitHTML
A frontend monitoring board for Zabbix server.
Zabbix Sender621165 years ago5October 17, 20174apache-2.0Java
java zabbix-sender
Zabbix Wechat54
4 years ago1apache-2.0Python
An auto-notification alarm system
Nginx Zabbix Template53
4 years agoPython
nginx monitor for zabbix and include template
Alternatives To Docker Zabbix
Select To Compare


Alternative Project Comparisons
Readme

Goal

Monitor resource used by running containers

TODO

  • [x] Get informations about percent used CPU, percent used RAM memory and network
  • [x] Add options to get information from all containers and not only using id container
  • [x] Create DockerService package
  • [ ] Write tests for package
  • [ ] Create zabbix module
  • [ ] Create python package, to install with pip

Requirements

install all libraries (docker-py and py-zabbix)

# pip install -r requirements.txt

install libraries separately

docker-py library

# pip install docker-py

or

# git clone [email protected]:docker/docker-py.git
# cd docker-py
# python setup.py install

py-zabbix library

# pip install py-zabbix

or

# git clone [email protected]:blacked/py-zabbix.git
# cd py-zabbix
# python setup.py install

Debian problem to use pip

To fix this problem

ImportError: cannot import name 'IncompleteRead'

Reinstall pip package

easy_install -U pip

Packages used

  • python 2.7.9
  • docker 1.6
  • zabbix agent and server 2.4

Initial Configuration

Docker host server

# apt-get install zabbix-agent sudo
# git clone [email protected]:Gomex/docker-zabbix.git
# cd docker-docker
# cp *.py /etc/zabbix
# chown -R zabbix /etc/zabbix/
# chmod u+x /etc/zabbix/*.py
# echo 'Defaults:username !requiretty' >> /etc/sudoers
# echo "zabbix ALL=NOPASSWD: /etc/zabbix/docker_stats.py" >> /etc/sudoers
# echo "EnableRemoteCommands=1" >> /etc/zabbix/zabbix_agentd.conf
# echo "Timeout=30" >> /etc/zabbix/zabbix_agentd.conf
# /etc/init.d/zabbix-agent restart

Zabbix server

  1. Import that template
  2. Create a host to your Docker host server and link the template "Template Docker Host"
  3. Wait the containers :P

If you don't have a zabbix server to test

# docker pull berngp/docker-zabbix
# docker run --name zabbix-server -d -P berngp/docker-zabbix

Check which port was mapped to tcp/80

# docker ps | grep "docker-zabbix"

Check which ip was mapped to new zabbix server container and put in your zabbix-agent conf file

# docker inspect zabbix-server | grep -i ipaddress

Using python3

To use python 3 is necessary install pip for python3

# aptitude install python3-pip

And install its requiriments

# pip3 install -r requirements.txt

Debian problem to use pip

To fix this problem

ImportError: cannot import name 'IncompleteRead'

Reinstall pip package

easy_install3 -U pip

Inspiration

I decided create this solution after read that news and used part of code to start my own.

Popular Server Projects
Popular Zabbix Projects
Popular Networking Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Docker
Server
Hosts
Monitor
Zabbix