feat: switch to zabbix-agent2

This commit is contained in:
Winston Smith 2022-10-12 14:11:17 +02:00
parent dfa2c96b6a
commit 4cefae2b7d
1 changed files with 9 additions and 9 deletions

View File

@ -24,7 +24,7 @@ Vagrant.configure("2") do |config|
curl -o /tmp/zabbix_6.0.deb https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bdebian11_all.deb
dpkg -i /tmp/zabbix_6.0.deb
apt update -y
apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent mariadb-server mariadb-client nginx
apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2 mariadb-server mariadb-client nginx
systemctl enable --now mysql
mysql -uroot -e 'create database zabbix character set utf8mb4 collate utf8mb4_bin'
mysql -uroot -e 'create user zabbix@localhost identified by "eattherich"'
@ -35,8 +35,8 @@ Vagrant.configure("2") do |config|
echo 'DBPassword=eattherich' >> /etc/zabbix/zabbix_server.conf
sed -i 's/#//g' /etc/zabbix/nginx.conf
sed -i 's/example.com/zabbix.local/g' /etc/zabbix/nginx.conf
systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm
systemctl enable zabbix-server zabbix-agent nginx php7.4-fpm
systemctl restart zabbix-server zabbix-agent2 nginx php7.4-fpm
systemctl enable zabbix-server zabbix-agent2 nginx php7.4-fpm
reboot
SHELL
end
@ -56,7 +56,7 @@ Vagrant.configure("2") do |config|
curl -o /tmp/zabbix_6.0.deb https://repo.zabbix.com/zabbix/6.0/debian/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bdebian11_all.deb
dpkg -i /tmp/zabbix_6.0.deb
apt update -y
apt install -y zabbix-agent
apt install -y zabbix-agent2
apt install -y ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@ -66,9 +66,9 @@ Vagrant.configure("2") do |config|
apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable --now containerd docker
sed -i 's/ServerActive=127.0.0.1/ServerActive=192.168.56.2/g' /etc/zabbix/zabbix_agentd.conf
sed -i 's/Hostname=Zabbix server/Hostname=docker/g' /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent
sed -i 's/ServerActive=127.0.0.1/ServerActive=192.168.56.2/g' /etc/zabbix/zabbix_agent2.conf
sed -i 's/Hostname=Zabbix server/Hostname=docker/g' /etc/zabbix/zabbix_agent2.conf
systemctl restart zabbix-agent2
SHELL
end
@ -82,8 +82,8 @@ Vagrant.configure("2") do |config|
end
windows.vm.provision "shell", inline: <<-SHELL
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile("https://cdn.zabbix.com/zabbix/binaries/stable/6.0/6.0.9/zabbix_agent-6.0.9-windows-amd64-openssl.msi","C:\zabbix\zabbix-agent\zabbix-agent.msi")
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\installers\SQLIO.msi\zabbix-agent.msi /quiet'
$WebClient.DownloadFile("https://cdn.zabbix.com/zabbix/binaries/stable/6.0/6.0.9/zabbix_agent2-6.0.9-windows-amd64-openssl.msi","C:\zabbix\zabbix-agent\zabbix-agent2.msi")
Start-Process msiexec.exe -Wait -ArgumentList '/I C:\installers\SQLIO.msi\zabbix-agent2.msi /quiet'
SHELL
end
end