sudo apt-get update sudo apt-get upgrade
wget https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb sudo dpkg -i zabbix-release_latest+debian12_all.deb sudo apt-get update sudo apt-get install zabbix-agent2 zabbix-agent2-plugin-* zabbix-get
sudo systemctl enable zabbix-agent2 sudo systemctl restart zabbix-agent2
sudo usermod -aG docker zabbix
sudo nano /etc/zabbix/zabbix_agent2.conf
Füge folgende Zeilen hinzu:
Plugins.Docker.Endpoint=unix:///var/run/docker.sock Server=127.0.0.1,::1,172.30.1.170 ServerActive=127.0.0.1,::1,172.30.1.170
sudo systemctl restart zabbix-agent2
sudo docker run hello-world
zabbix_get -s localhost -k docker.info
Beispielausgabe:
{"Id":"e948ac0f-92df-4fe8-bc3c-3de3b2b3a230", "Containers":5, "ContainersRunning":3, ...}