部署zabbix 6.x
建议使用红帽系统。
https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.9-x86_64-minimal.iso
1> 配置安装yum源
[root@zabbix ~]# yum install https://mirrors.huaweicloud.com/zabbix/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-3.el8.noarch.rpm
更改使用国内镜像源:
[root@zabbix ~]# sed -i 's#https://repo.zabbix.com#https://mirrors.huaweicloud.com/zabbix#' /etc/yum.repos.d/zabbix.repo
2> 安装zabbix sever
[root@zabbix ~]# yum install -y zabbix-server-mysql
3> 安装zabbix agent
[root@zabbix ~]# yum install zabbix-agent2 -y
4> 安装zabbix web
[root@zabbix ~]# yum install zabbix-web-mysql zabbix-nginx-conf.noarch nginx -y
5> 安装数据库
[root@zabbix ~]# yum install mysql-server -y
6> 配置数据库
[root@zabbix ~]# systemctl enable --now mysqldmysql> create database zabbix charset utf8 collate utf8_bin;Query OK, 1 row affected, 2 warnings (0.02 sec)mysql> create user zabbix@localhost identified with mysql_native_password by 'zabbix';Query OK, 0 rows affected (0.01 sec)mysql> grant all privileges on zabbix.* to zabbix@localhost;Query OK, 0 rows affected (0.01 sec)
导入:
[root@zabbix ~]# yum install zabbix-sql-scripts.noarch -y[root@zabbix ~]# cd /usr/share/zabbix-sql-scripts/mysql[root@zabbix mysql]# zcat server.sql.gz | mysql zabbix[root@zabbix mysql]# mysql zabbix < double.sql[root@zabbix mysql]# mysql zabbix < history_pk_prepare.sql
若之前下载过mysql root账号有密码,则执行以下操作
[root@zabbix ~]# yum install zabbix-sql-scripts.noarch -y[root@zabbix ~]# cd /usr/share/zabbix-sql-scripts/mysql[root@zabbix mysql]# zcat server.sql.gz | mysql -uroot -p你的密码zabbix[root@zabbix mysql]# mysql -uroot -p你的密码 zabbix < double.sql[root@zabbix mysql]# mysql -uroot -p你的密码 zabbix < history_pk_prepare.sql
7> 为zabbix server配置数据库
[root@zabbix ~]# grep ^DB /etc/zabbix/zabbix_server.confDBName=zabbixDBUser=zabbixDBPassword=zabbix
8> 启动服务,web界面安装
[root@zabbix ~]# systemctl enable --now nginx.service php-fpm.service zabbix-server.service zabbix-agent2.service#如果此时报错,查看message日志,发现该信息
Jun 12 19:16:40 localhost zabbix_server[23250]: /usr/sbin/zabbix_server: symbol lookup error: /usr/sbin/zabbix_server: undefined symbol: usmAES192PrivProtocol
导致zabbix.server启动失败
说明:安装系统依赖包的过程中所安装的net-snmp-*的版本过低。
解决办法:升级net-snmp
[root@zabbix conf.d]# yum -y update net-snmp-*[root@zabbix conf.d]# yum install zabbix-web-service -y[root@zabbix conf.d]# systemctl enable --now zabbix-web-service.service
切换php版本:
[root@zabbix ~]# dnf module switch-to php:7.4
修改zabbix.conf
[root@zabbix ~]# vim /etc/nginx/conf.d/zabbix.conf server {listen 8080;server_name your_IP;
重启服务:
systemctl restart nginx.service php-fpm.service zabbix-server.service zabbix-agent2.service
ip登录:
http://your_IP:8080
Zabbix 6.0 Web界面中文汉化
复制windows下中文字体–图形