首页 技术 正文
技术 2022年11月14日
0 收藏 986 点赞 3,591 浏览 3581 个字

思考

现在有这样一个需求,业务场景想要使用的监控模版没有3.0版本的,只有2.0,我们都知道2.0的模版无法导入进3.0版本的zabbix中,这个时候应该怎么获得3.0的监控模版哪?本篇博客将详细演示如何将一个2.0版本的监控模版升级到3.0。

安装2.2版本的zabbix

第一步:下载zabbix

[root@agent ~]# rpm -i https://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm
[root@agent yum.repos.d]# yum install zabbix-release-3.0-1.el7.noarch.rpm -y
[root@agent yum.repos.d]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

第二步:下载mysql并启动

[root@agent yum.repos.d]# yum install mariadb-server -y
[root@agent yum.repos.d]# systemctl restart mariadb

第三步:配置mysql

[root@agent yum.repos.d]# cp /usr/share/doc/zabbix-server-mysql-2.2.23/create/data.sql /root

[root@agent yum.repos.d]# cp /usr/share/doc/zabbix-server-mysql-2.2.23/create/schema.sql /root
  [root@agent yum.repos.d]# cp /usr/share/doc/zabbix-server-mysql-2.2.23/create/images.sql /root

[root@agent ~]# gunzip create.sql.gz
[root@agent yum.repos.d]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-log MySQL Community Server (GPL)Copyright (c) , , Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [(none)]> create database zabbix;
MySQL [(none)]> use zabbix;
MySQL [(none)]> source /root/schema.sql
MySQL [(none)]> source /root/data.sql
MySQL [(none)]> source /root/images.sql
MySQL [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by '123';

第四 步:启动http

[root@agent ~]# systemctl restart httpd
[root@agent ~]# ss -tnl | grep
LISTEN ::: :::*

第五步:配置相关文件

[root@agent ~]# vim /etc/httpd/conf.d/zabbix.conf
<IfModule mod_php5.c>
php_value max_execution_time
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time
php_value max_input_vars
php_value always_populate_raw_post_data -
php_value date.timezone Asia/Shanghai #时区修改为Asia/Shanghai
[root@agent ~]# vim /etc/zabbix/zabbix_server.conf
...
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=123 #填写数据库密码### Option: DBSocket
# Path to MySQL socket.
...

第六步:重启zabbix-server

[root@agent yum.repos.d]# systemctl restart zabbix-server

第五步:浏览器查看并配置

输入IP/zabbix

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

点击next

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

确认无误点击next

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

输入账号和密码,提示正确后点击next

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

直接点击next

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

点击下一步

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

点击finish

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

输入账号Admin 密码zabbix,点击sign in

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

看到如上界面表示安装成功了。

导入模板

第一步:选择configuration > templates

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

第二步:导入模板

选择右上角import>选择文件

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

选择文件

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

显示导入成功

注:这里我准备了一个2.0的模板

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

把这个包传到linux中安装

[root@agent ~]# rz
[root@agent ~]# yum install percona-zabbix-templates-1.1.-.noarch.rpm -y
...
Scripts are installed to /var/lib/zabbix/percona/scripts
Templates are installed to /var/lib/zabbix/percona/templates #这里提示我们这个模板被放在这个目录下了
Verifying : percona-zabbix-templates-1.1.-.noarch / Installed:
percona-zabbix-templates.noarch :1.1.- Complete!

把这个模板传回window

[root@agent ~]# cd //var/lib/zabbix/percona/templates
[root@agent templates]# ls
userparameter_percona_mysql.conf zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.8.xml
[root@agent templates]# sz zabbix_agent_template_percona_mysql_server_ht_2.0.9-sver1.1.8.xml

升级zabbix

升级zabbix的话,模板也会随之升级,这样我们就获得了一个3.0的模板

第一步:关掉zabbix-server以及mysql

[root@agent ~]# systemctl stop zabbix-server
[root@agent ~]# pkill mysqld
[root@agent ~]# ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN *: *:*
LISTEN *: *:*
LISTEN 127.0.0.1: *:*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*
LISTEN ::: :::*

第二步:准备3.0的仓库

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

第三步:下载zabbix3.0

[root@agent yum.repos.d]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

第四步:启动mysql即zabbix-server。配置文件等都不需要修改,只要重启即可。

[root@agent yum.repos.d]# mysqld &
[]
[root@agent yum.repos.d]# systemctl restart zabbix-server

第五步:刷新浏览器

点击刚才我们上传的模板,点击最下面的export

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

第六步:打开看版本是否升级为3.0

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

第七步:把这个3.0的版本导入到zabbix中。显示导入成功

分布式系统监视zabbix讲解十一之zabbix升级–技术流ken

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295