Giter VIP home page Giter VIP logo

docker-zabbix-agent's Introduction

docker-zabbix-agent

Dockerized Zabbix agent for host and containers monitoring

  • Zabbix Agent patched for host monitoring via volume mounts
  • Docker container monitoring items included
  • CoreOS specific monitoring items included (you can use them if the host is CoreOS)
  • Enables host and container monitoring in all Linux-based hosts

Credits

Zabbix Agent patching and CoreOS monitoring template is based on bhuisgen's work at https://github.com/bhuisgen/docker-zabbix-coreos.

Usage

docker run -d \
  --restart=always \
  --name zabbix-agent \
  -p 10050:10050 \
  -v /proc:/host/proc:ro \
  -v /sys:/host/sys:ro \
  -v /dev:/host/dev:ro \
  -v /etc:/host/etc:ro \
  -v /var/run/docker.sock:/host/var/run/docker.sock \
  --env ZABBIX_SERVER=<zabbix server ip> \
  --env METADATA=<host metadata> \
  --env HOST=<host name> \
  --env PSKKey=<PSK TLS key> \
  --env PSKIdentity=<PSK identity> \
  digiapulssi/docker-zabbix-agent

Notes

  • Port mapping -p 10050:10050 is optional and required only for passive agent checks.
  • Metadata METADATA environment variable is optional and required only if auto registration is used in Zabbix Server.
  • If host HOST environment variable is omitted, the container generates a host name <host metadata>-<machine id>, where machine id is read from /etc/machine-id
  • PSK environment variables PSKKey and PSKIdentity are optional and required only if TLS PSK key is used for encryption and authentication with Zabbix Server
  • To view Zabbix agent log, run docker logs <container id>

Zabbix Items Supported

Linux OS Template

Standard Linux OS Template items are supported for host monitoring.

Linux Items Sample

Items known NOT to work properly:

  • Number of logged in users (Zabbix uses who command inside docker container which shows the number of loggers users inside the container, not inside the host)
  • Filesystem discover does not work but host filesystems can still be monitored with vfs.fs items
  • To get Checksum of /etc/passwd to work, you need to update item key to vfs.file.cksum[/host/etc/passwd]

CoreOS

The following items support host CoreOS monitoring. You can use them if the host is CoreOS.

A template file for Zabbix server is included: template_coreos.xml. The template items use active agent checks.

Supported items:

  • Etcd client port status
  • Etcd server port status
  • Memory used by processes etcd
  • Memory used by processes fleetd
  • Number of processes etcd
  • Number of processes fleetd
  • Number of processes locksmithd
  • Number of processes update_engine

CoreOS Items Sample

Docker Containers

Two template files for Zabbix server are included:

The template items monitor docker containers based on their names. Sometimes it's handier to do monitoring image-wise, eg. when container names are auto-generated. See Docker monitoring usage for a detailed documentation.

The following items support monitoring Docker containers running in the host:

  • Number of containers running in host
  • Discovery of docker containers running in the host
  • Monitoring of docker containers with the following items:
    • Status (0: exited with error or no such container, 1: running, 2: not started)
    • Uptime
    • CPU usage
    • Disk usage
    • Memory usage
    • Incoming network traffic (eth0)
    • Outgoing network traffic (eth0)

Docker Items Sample

Note that network traffic monitoring is based only on eth0 interface.

  • It doesn't work if --net=host option is used for the monitored container
  • Network monitoring does not show all traffic if additional network interfaces are used for the monitored container

Implementation Notes

The patched Zabbix Agent version is here and packaging scripts here.

docker-zabbix-agent's People

Contributors

bhuisgen avatar kompa3 avatar lethe3000 avatar mikesplain avatar sapajune avatar viveklanjekar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.