From 55e13418b14844856bd9b8f2a43f6ce930d27b5f Mon Sep 17 00:00:00 2001 From: phil Date: Sun, 21 Dec 2025 18:19:41 +0100 Subject: [PATCH] zabbix-agent2 pour zabbix serveur --- zabbix-docker/README.md | 2 ++ zabbix-docker/Vagrantfile | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/zabbix-docker/README.md b/zabbix-docker/README.md index 05b8f8d..8bb3866 100644 --- a/zabbix-docker/README.md +++ b/zabbix-docker/README.md @@ -16,3 +16,5 @@ Cette Vagrantfile : linux serveur serveur web apache zabbix-agent 2 +## Documentation + * cf https://www.virtualizationhowto.com/2025/11/why-i-switched-to-zabbix-for-monitoring-my-docker-containers/ diff --git a/zabbix-docker/Vagrantfile b/zabbix-docker/Vagrantfile index cfa2718..ce661a2 100644 --- a/zabbix-docker/Vagrantfile +++ b/zabbix-docker/Vagrantfile @@ -37,10 +37,12 @@ Vagrant.configure("2") do |config| # config.vm.network "private_network", ip: "192.168.33.10" # zabbix.vm.network "private_network", ip: "192.168.56.10" + zabbix.vm.network "private_network", ip: "192.168.56.10" + # Create a public network, which generally matched to bridged network. # Bridged networks make the machine appear as another physical device on # your network. - zabbix.vm.network "public_network" + #zabbix.vm.network "public_network" # Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is @@ -140,4 +142,24 @@ docker compose up SHELL end + config.vm.define "web1" do |srv| #VM No'1 + srv.vm.box = "debian/bookworm64" #Setting machine type + srv.vm.hostname = "web1" #Setting machine type + srv.vm.network "private_network", ip: "192.168.56.11" + srv.vm.provision "shell", inline: <<-SHELL + timedatectl set-timezone Europe/Paris + apt-get update + apt-get install -y wget curl vim apache2 + wget https://repo.zabbix.com/zabbix/7.4/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.4+debian12_all.deb + dpkg -i zabbix-release_latest_7.4+debian12_all.deb + apt update + apt install -y zabbix-agent2 + echo "Server=192.168.56.10" >> /etc/zabbix/zabbix_agent2.conf + echo "ServerActive=192.168.56.10" >> /etc/zabbix/zabbix_agent2.conf + echo "Hostname=web1" >> /etc/zabbix/zabbix_agent2.conf + systemctl restart zabbix-agent2 + SHELL + end + + end