纯shell一键安装部署zabbix6.0
部署环境:
[zabbix6 root ~] #cat deploy_zabbix6.sh
#!/bin/bash
#Author:demoduan
#Blog:https://www.cnblogs.com/demoduan
IP=`ip -4 a show ens160 |grep inet |awk '{print $2}' |cut -d/ -f1`
systemctl disable firewalld.service --now
setenforce 0
rpm -Uvh http://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
yum -y install zabbix-server-mysql.x86_64 zabbix-web-mysql.noarch zabbix-nginx-conf.noarch
yum -y install mariadb-server
systemctl enable mariadb.service --now
cat >zabbix.txt <
grant all on zabbix.* to zabbix@localhost identified by 'zabbix';
flush privileges;
exit
EOF
mysql
rpm -Uvh http://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-sql-scripts-6.0.0-1.el8.noarch.rpm
path1=`rpm -ql zabbix-sql-scripts |grep 'server.sql.gz' |grep mysql`
zcat $path1 |mysql -uzabbix -pzabbix zabbix
target1=`egrep -v "^#|^$" /etc/zabbix/zabbix_server.conf -n |grep DBUser |cut -d: -f1`
sed -i "${target1}a DBPassword=zabbix" /etc/zabbix/zabbix_server.conf
path2=`find /etc/ -name zabbix.conf |grep nginx`
sed -i "2,3s/#//; s/example.com/$IP/" $path2
systemctl restart zabbix-server.service php-fpm.service nginx.service
systemctl enable zabbix-server.service php-fpm.service nginx.service
上面脚本执行成功后,在web界面访问本机IP
点开语言后发现只有英文(原因是没有安装中文包)
接下来安装中文包,然后重启zabbix服务,并刷新web界面
[zabbix6 root ~] #yum -y install langpacks-zh_CN glibc-common
[zabbix6 root ~] #systemctl restart zabbix-server.service
刷新后就可以选择中文
这里可以选择时区,相比zabbix5来说,少了修改时区的配置文件步骤,还可以选择主题颜色
登录后,界面和zabbix5基本一致