Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35e0512f51 | ||
|
|
55e13418b1 | ||
|
|
4dea2e0bb1 |
@@ -1,6 +1,6 @@
|
|||||||
# vagrant
|
# vagrant
|
||||||
|
|
||||||
le 2025-12-18 9h30 - ps
|
le 2025-12-21 16h30 - ps
|
||||||
|
|
||||||
Ce dépôt héberge des **Vagrantfile** dont :
|
Ce dépôt héberge des **Vagrantfile** dont :
|
||||||
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
* **dns** : Vagrantfile pour 2 serveurs **Bind9** (1 maitre et un esclave), tests **goss** chainés
|
||||||
@@ -31,4 +31,5 @@ Ce dépôt héberge des **Vagrantfile** dont :
|
|||||||
* **wazuh** : Vagrantfile + playbook pour serveur **wazuh** 4.10 et client Debian
|
* **wazuh** : Vagrantfile + playbook pour serveur **wazuh** 4.10 et client Debian
|
||||||
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
* **wp-lb** : Wordpress web1 et web2, lb HaProxy, nfs, db Mariadb - Vagrantfile + playbooks
|
||||||
* **zabbix** : Vagrantfile pour VM Debian 12 **zabbix7** Srv et VM Debian 12 **web1** apache, zabbix agent2
|
* **zabbix** : Vagrantfile pour VM Debian 12 **zabbix7** Srv et VM Debian 12 **web1** apache, zabbix agent2
|
||||||
|
* **zabbix-docker** : Vagrantfile pour VM Debian 12 **zabbix** Srv avec docker et VM Debian 12 **web1** apache, zabbix agent2
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,19 @@
|
|||||||
|
|
||||||
|
|
||||||
Cette Vagrantfile :
|
Cette Vagrantfile :
|
||||||
* créée la VM **zabbix*, installe **docker**, et un fichier **compose.yml**
|
* créée la VM **zabbix**, installe **docker**, et un fichier **compose.yml**
|
||||||
* créée la VM **web1**, installe apache2 ainsi que **zabbix-agent2** (mode active) et l'inscrit sur **zabbix**
|
* créée la VM **web1**, installe **apache2** ainsi que **zabbix-agent2** (mode active) et l'inscrit sur **zabbix**
|
||||||
|
|
||||||
|
|
||||||
## Mode opératoire
|
## Mode opératoire
|
||||||
- vagrant up zabbix
|
```
|
||||||
- vagrant up web1
|
vagrant up zabbix
|
||||||
- une fois connecté à zabbix (Admin/zabbix)
|
vagrant up web1
|
||||||
ajouter l'hote avec son adresse IP 192.168.56.10 et les templates :
|
```
|
||||||
|
* une fois connecté à zabbix (Admin/zabbix)
|
||||||
|
* ajouter l'hote avec son adresse IP 192.168.56.10 et les templates :
|
||||||
linux serveur
|
linux serveur
|
||||||
serveur web apache zabbix-agent 2
|
serveur web apache zabbix-agent 2
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
* cf https://www.virtualizationhowto.com/2025/11/why-i-switched-to-zabbix-for-monitoring-my-docker-containers/
|
||||||
|
|||||||
24
zabbix-docker/Vagrantfile
vendored
24
zabbix-docker/Vagrantfile
vendored
@@ -37,10 +37,12 @@ Vagrant.configure("2") do |config|
|
|||||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
# 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"
|
||||||
|
|
||||||
|
zabbix.vm.network "private_network", ip: "192.168.56.10"
|
||||||
|
|
||||||
# Create a public network, which generally matched to bridged network.
|
# Create a public network, which generally matched to bridged network.
|
||||||
# Bridged networks make the machine appear as another physical device on
|
# Bridged networks make the machine appear as another physical device on
|
||||||
# your network.
|
# your network.
|
||||||
zabbix.vm.network "public_network"
|
#zabbix.vm.network "public_network"
|
||||||
|
|
||||||
# Share an additional folder to the guest VM. The first argument is
|
# 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
|
# the path on the host to the actual folder. The second argument is
|
||||||
@@ -140,4 +142,24 @@ docker compose up
|
|||||||
SHELL
|
SHELL
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user