登录后台

页面导航

本文编写于 320 天前,最后修改于 182 天前,其中某些信息可能已经过时。

环境centos7

1. 关闭服务

systemctl stop zabbix-server
systemctl mstop httpd
systemctl stop mariadb

2.备份zabbix文件

mkdir /opt/zabbix-backup/
cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
cp /etc/httpd/conf.d/zabbix.conf  /opt/zabbix-backup/
cp -R /usr/share/zabbix/ /opt/zabbix-backup/
cp -R /usr/share/doc/zabbix-* /opt/zabbix-backup/

3.更新zabbix安装源

rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

4.yum升级,yum如果尝试镜像失败,到阿里云下载rpm包升级

yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-server

5.查看是否升级成功,最右边状态为@zabbix

[root@zabbix-server ~]# yum list installed |grep zabbix
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
fping.x86_64                            3.10-1.el7                     @zabbix-non-supported
iksemel.x86_64                          1.4-2.el7.centos               @zabbix-non-supported
zabbix-agent.x86_64                     4.4.3-1.el7                    @zabbix  
zabbix-get.x86_64                       4.4.3-1.el7                    @zabbix  
zabbix-release.noarch                   4.4-1.el7                      installed
zabbix-server-mysql.x86_64              4.4.3-1.el7                    @zabbix  
zabbix-web.noarch                       4.4.3-1.el7                    @zabbix  
zabbix-web-mysql.noarch                 4.4.3-1.el7                    @zabbix  

6.启动zabbix-server、httpd、mariadb,并登陆前端


若出现数据库版本错误(The frontend does not match Zabbix database),请手动修改mysql的版本号

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| zabbix             |
+--------------------+
4 rows in set (0.00 sec)
 
MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [zabbix]> update dbversion set mandatory=3000000;
Query OK, 1 row affected (0.09 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
MariaDB [zabbix]> flush privileges;
Query OK, 0 rows affected (0.05 sec)

交换机模板备注

接入层交换机建议使用Template Module Interfaces Generic SNMPv2,汇聚层交换机建议关联Template Module Interfaces SNMPv2,因为接入层往往接了很多客户端,若接入了Template Module Interfaces SNMPv2,那么用户的日常开关机也会报警。