Skip to content

thetorminal/zabbix-docker-image-updates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zabbix docker image update monitoring

Monitoring of docker image updates with Zabbix.

Description

Based on “dockcheck” (CLI query to check updates): Github - dockcheck

Shows number of available docker image updates on host (Example: "2 Docker Image updates on host-xyz").
Important: The Docker image version must be specified with :latest (e.g. in a docker-compose file), a fixed version number such as mariadb:10.6 does not work.

Example notification:
docker_image_zabbix

Tested with:

  • Zabbix Server 7.0.5
  • zabbix-agent2 (on Debian 12 server)

Getting Started

Dependencies

  • dockcheck.sh
  • regclient/regctl (Licensed under Apache-2.0 License)
  • Zabbix-Server with timeouts set up to 30 seconds! (Timeout=30)
  • Host with zabbix-agent2 and docker installed

Installing

On Zabbix frontend server:

  • Download and import the template docker-image-update.yaml
  • Assign the Template Docker Image Updates' to the docker host(s) you want to monitor

On all hosts you want to monitor:

Manual:

  • Install and configure package zabbix-agent2 (if not installed):
    apt-get install zabbix-agent2  
  • download "dockcheck.sh" from dockcheck repository to new directory /etc/zabbix/scripts/ and change permission:
    mkdir /etc/zabbix/scripts
    curl -L https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh -o /etc/zabbix/scripts/dockcheck.sh
    chown zabbix:zabbix /etc/zabbix/scripts/dockcheck.sh && chmod 0755 /etc/zabbix/scripts/dockcheck.sh
  • run "dockcheck.sh" to install regctl:
    bash /etc/zabbix/scripts/dockcheck.sh -n
    # Confirm with "y":   
    Required dependency 'regctl' missing, do you want it downloaded? y/[n] y  
    chown zabbix:zabbix dockcheck.sh && chmod 0755 /etc/zabbix/scripts/regctl
  • add "dockcheck.conf" to /etc/zabbix/zabbix_agent2.d/:
    curl -L https://raw.githubusercontent.com/thetorminal/zabbix-docker-image-updates/refs/heads/main/dockcheck.conf -o /etc/zabbix/zabbix_agent2.d/dockcheck.conf
  • restart zabbix-agent2
    systemctl restart zabbix-agent2

via Ansible playbook:

  • run the playbook zabbix-dockcheck.yml on host(s) you want to monitor docker on.

Version History

  • 0.2
    • fixed #2 (dockcheck changed message from "no updates installed" to "no updates available")
    • fixed #2 and #3 (no updates equaled in an error message in zabbix)
  • 0.1
    • Initial Release

To-Do

  • List name of image, which needs an update (using Zabbix LLD)
    • currently in progress

Acknowledgments

About

Zabbix docker image updates monitoring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published