diff --git a/zabbix/README.md b/zabbix/README.md new file mode 100644 index 0000000..54d668b --- /dev/null +++ b/zabbix/README.md @@ -0,0 +1,17 @@ +# Zabbix + +## Présentation + +Cette Vagrantfile : + * créée la VM **zabbix7**, installe **zabbix-server** 7.2, apache2, mariadb-server ainsi que **zabbix-agent** + * créée la VM **web1**, installe apache2 ainsi que **zabbix-agent2** (mode active) et l'inscrit sur **zabbix7** + + +## Mode opératoire + - vagrant up zabbix7 + - vagrant up web1 + - une fois connecté à zabbix7 (Admin/zabbix) + ajouter l'hote avec son adresse IP 192.168.56.10 et les templates : + linux serveur + serveur web apache zabbix-agent 2 + diff --git a/zabbix/Vagrantfile b/zabbix/Vagrantfile index 71e4c58..7b7e6ab 100644 --- a/zabbix/Vagrantfile +++ b/zabbix/Vagrantfile @@ -75,18 +75,20 @@ Vagrant.configure("2") do |config| # documentation for more information about their specific syntax and use. zabbix7.vm.provision "shell", inline: <<-SHELL timedatectl set-timezone Europe/Paris - apt-get update + apt-get update && apt upgrade -y apt-get install -y wget curl vim - wget https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-2+debian12_all.deb - dpkg -i zabbix-release_7.0-2+debian12_all.deb + wget https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian12_all.deb + dpkg -i zabbix-release_latest_7.2+debian12_all.deb apt-get update apt-get install -y apache2 mariadb-server - apt-get install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent + apt-get install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent echo 'create database zabbix character set utf8mb4 collate utf8mb4_bin;' | mysql -u root echo "create user zabbix@localhost identified by 'password';" | mysql -u root echo 'grant all privileges on zabbix.* to zabbix@localhost;' | mysql -u root echo 'set global log_bin_trust_function_creators = 1;' | mysql -u root - zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -u zabbix -ppassword zabbix + #zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix + zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz|mysql --default-character-set=utf8mb4 -u zabbix -ppassword zabbix + #zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz| echo 'set global log_bin_trust_function_creators = 0;' | mysql -u root sed -i 's/# DBPassword=/DBPassword=password/' /etc/zabbix/zabbix_server.conf systemctl restart zabbix-server zabbix-agent apache2 @@ -104,9 +106,9 @@ Vagrant.configure("2") do |config| timedatectl set-timezone Europe/Paris apt-get update apt-get install -y wget curl vim apache2 - wget https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_7.0-2+debian12_all.deb - dpkg -i zabbix-release_7.0-2+debian12_all.deb - apt-get update + wget https://repo.zabbix.com/zabbix/7.2/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian12_all.deb + dpkg -i zabbix-release_latest_7.2+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