export http_proxy="http://10.121.38.1:8080/"
export https_proxy="http://10.121.38.1:8080/"
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 install -y apache2 mariadb-server
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
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
systemctl enable zabbix-server zabbix-agent apache2
localectl set-locale LANG=en_US.UTF-8
systemctl restart zabbix-server zabbix-agent apache2
