ARCHIVESDRIVE HB

オイラはホームベーカリー!

Zabbix 3.4 -> 4.0 にアップデートした

した。

1 Red Hat Enterprise Linux/CentOS [Zabbix Documentation 4.0]

このページにコマンドが記載されているので、その通りに作業すれば普通にオッケー。 ただ一点ハマったので注意しておく。

yum のキャッシュに邪魔される場合がある

Zabbix 4.0 のリポジトリを用意する前に、既存の 3.4 リポジトリを利用する設定のまま yum update を叩いてアップデートを確認してしまったので、「ローカルに zabbix 3.4 のアップデート(先は 4.0 ではなく)、 3.4 の最新版あるぞ!」と記憶されてしまいもうした。 で、4.0 リポジトリをインストールし yum.repo.d 以下のコンフィグで enable=1 としても、 4.0 が見えないわけですね。 しゃーなし一回インストールするか! と思うと、以下のようになります。

[root@backup-monitering ~]# yum update zabbix-server-mysql zabbix-web-mysql zabbix-agent
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
16 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:3.4.14-1.el7 will be an update
---> Package zabbix-server-mysql.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-server-mysql.x86_64 0:3.4.14-1.el7 will be an update
---> Package zabbix-web-mysql.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web-database = 3.4.13-1.el7 for package: zabbix-web-3.4.13-1.el7.noarch
---> Package zabbix-web-mysql.noarch 0:3.4.14-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web = 3.4.13-1.el7 for package: zabbix-web-japanese-3.4.13-1.el7.noarch
---> Package zabbix-web.noarch 0:3.4.14-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web-japanese.noarch 0:3.4.13-1.el7 will be updated
---> Package zabbix-web-japanese.noarch 0:3.4.14-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================
 Package                                      Arch                            Version                               Repository                       Size
==========================================================================================================================================================
Updating:
 zabbix-agent                                 x86_64                          3.4.14-1.el7                          zabbix                          367 k
 zabbix-server-mysql                          x86_64                          3.4.14-1.el7                          zabbix                          2.0 M
 zabbix-web-mysql                             noarch                          3.4.14-1.el7                          zabbix                          7.1 k
Updating for dependencies:
 zabbix-web                                   noarch                          3.4.14-1.el7                          zabbix                          2.7 M
 zabbix-web-japanese                          noarch                          3.4.14-1.el7                          zabbix                          7.5 k

Transaction Summary
==========================================================================================================================================================
Upgrade  3 Packages (+2 Dependent packages)

Total download size: 5.0 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
zabbix-server-mysql-3.4.14-1.e FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-server-mysql-3.4.14-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-agent-3.4.14-1.el7.x86_ FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-3.4.14-1.el7.x86_64.rpm: [Errno 14] HTTP Error 404 - Not Found0.0 B/s |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-3.4.14-1.el7.noarch FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found  0.0 B/s |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-japanese-3.4.14-1.e FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-japanese-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found |    0 B  --:--:-- ETA
Trying other mirror.
zabbix-web-mysql-3.4.14-1.el7. FAILED
http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-web-mysql-3.4.14-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not FoundB/s |    0 B  --:--:-- ETA
Trying other mirror.


Error downloading packages:
  zabbix-agent-3.4.14-1.el7.x86_64: [Errno 256] No more mirrors to try.
  zabbix-web-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.
  zabbix-server-mysql-3.4.14-1.el7.x86_64: [Errno 256] No more mirrors to try.
  zabbix-web-japanese-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.
  zabbix-web-mysql-3.4.14-1.el7.noarch: [Errno 256] No more mirrors to try.

参照先がないので当然ですね。以下のようにキャッシュやらを消して改善します。

yum キャッシュとか消す

[root@backup-monitering ~]# yum clean all
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Cleaning repos: amzn2-core amzn2extra-docker mysql-connectors-community mysql-tools-community mysql57-community zabbix zabbix-non-supported
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@backup-monitering ~]# rm -rf /var/cache/yum

これでオッケーです。

Zabbix 4.0 にアップデートする

[root@backup-monitering ~]# yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core                                                                                                                         | 2.4 kB  00:00:00
amzn2extra-docker                                                                                                                  | 1.3 kB  00:00:00
mysql-connectors-community                                                                                                         | 2.5 kB  00:00:00
mysql-tools-community                                                                                                              | 2.5 kB  00:00:00
mysql57-community                                                                                                                  | 2.5 kB  00:00:00
zabbix                                                                                                                             | 2.9 kB  00:00:00
zabbix-non-supported                                                                                                               |  951 B  00:00:00
(1/8): amzn2-core/2/x86_64/group_gz                                                                                                | 2.4 kB  00:00:00
(2/8): amzn2-core/2/x86_64/updateinfo                                                                                              |  53 kB  00:00:00
(3/8): amzn2extra-docker/2/x86_64/primary_db                                                                                       |  32 kB  00:00:00
(4/8): amzn2-core/2/x86_64/primary_db                                                                                              |  22 MB  00:00:00
(5/8): mysql-connectors-community/x86_64/primary_db                                                                                |  29 kB  00:00:00
(6/8): mysql-tools-community/x86_64/primary_db                                                                                     |  48 kB  00:00:00
(7/8): mysql57-community/x86_64/primary_db                                                                                         | 162 kB  00:00:00
(8/8): zabbix/x86_64/primary_db                                                                                                    |  19 kB  00:00:00
zabbix-non-supported/x86_64/primary                                                                                                | 1.6 kB  00:00:00
zabbix-non-supported                                                                                                                                  4/4
16 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-agent.x86_64 0:4.0.1-1.el7 will be an update
---> Package zabbix-server-mysql.x86_64 0:3.4.13-1.el7 will be updated
---> Package zabbix-server-mysql.x86_64 0:4.0.1-1.el7 will be an update
---> Package zabbix-web-mysql.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web-database = 3.4.13-1.el7 for package: zabbix-web-3.4.13-1.el7.noarch
---> Package zabbix-web-mysql.noarch 0:4.0.1-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web.noarch 0:3.4.13-1.el7 will be updated
--> Processing Dependency: zabbix-web = 3.4.13-1.el7 for package: zabbix-web-japanese-3.4.13-1.el7.noarch
---> Package zabbix-web.noarch 0:4.0.1-1.el7 will be an update
--> Running transaction check
---> Package zabbix-web-japanese.noarch 0:3.4.13-1.el7 will be updated
---> Package zabbix-web-japanese.noarch 0:4.0.1-1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================
 Package                                      Arch                            Version                               Repository                       Size
==========================================================================================================================================================
Updating:
 zabbix-agent                                 x86_64                          4.0.1-1.el7                           zabbix                          381 k
 zabbix-server-mysql                          x86_64                          4.0.1-1.el7                           zabbix                          2.1 M
 zabbix-web-mysql                             noarch                          4.0.1-1.el7                           zabbix                          7.8 k
Updating for dependencies:
 zabbix-web                                   noarch                          4.0.1-1.el7                           zabbix                          2.7 M
 zabbix-web-japanese                          noarch                          4.0.1-1.el7                           zabbix                          8.3 k

Transaction Summary
==========================================================================================================================================================
Upgrade  3 Packages (+2 Dependent packages)

Total download size: 5.2 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): zabbix-agent-4.0.1-1.el7.x86_64.rpm                                                                                         | 381 kB  00:00:00
(2/5): zabbix-server-mysql-4.0.1-1.el7.x86_64.rpm                                                                                  | 2.1 MB  00:00:01
(3/5): zabbix-web-japanese-4.0.1-1.el7.noarch.rpm                                                                                  | 8.3 kB  00:00:00
(4/5): zabbix-web-4.0.1-1.el7.noarch.rpm                                                                                           | 2.7 MB  00:00:00
(5/5): zabbix-web-mysql-4.0.1-1.el7.noarch.rpm                                                                                     | 7.8 kB  00:00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                     3.9 MB/s | 5.2 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : zabbix-web-mysql-4.0.1-1.el7.noarch                                                                                                   1/10
  Updating   : zabbix-web-4.0.1-1.el7.noarch                                                                                                         2/10
  Updating   : zabbix-web-japanese-4.0.1-1.el7.noarch                                                                                                3/10
  Updating   : zabbix-server-mysql-4.0.1-1.el7.x86_64                                                                                                4/10
warning: /etc/zabbix/zabbix_server.conf created as /etc/zabbix/zabbix_server.conf.rpmnew
  Updating   : zabbix-agent-4.0.1-1.el7.x86_64                                                                                                       5/10
  Cleanup    : zabbix-web-japanese-3.4.13-1.el7.noarch                                                                                               6/10
  Cleanup    : zabbix-web-mysql-3.4.13-1.el7.noarch                                                                                                  7/10
  Cleanup    : zabbix-web-3.4.13-1.el7.noarch                                                                                                        8/10
  Cleanup    : zabbix-server-mysql-3.4.13-1.el7.x86_64                                                                                               9/10
  Cleanup    : zabbix-agent-3.4.13-1.el7.x86_64                                                                                                     10/10
  Verifying  : zabbix-web-4.0.1-1.el7.noarch                                                                                                         1/10
  Verifying  : zabbix-web-japanese-4.0.1-1.el7.noarch                                                                                                2/10
  Verifying  : zabbix-agent-4.0.1-1.el7.x86_64                                                                                                       3/10
  Verifying  : zabbix-web-mysql-4.0.1-1.el7.noarch                                                                                                   4/10
  Verifying  : zabbix-server-mysql-4.0.1-1.el7.x86_64                                                                                                5/10
  Verifying  : zabbix-agent-3.4.13-1.el7.x86_64                                                                                                      6/10
  Verifying  : zabbix-web-3.4.13-1.el7.noarch                                                                                                        7/10
  Verifying  : zabbix-web-mysql-3.4.13-1.el7.noarch                                                                                                  8/10
  Verifying  : zabbix-web-japanese-3.4.13-1.el7.noarch                                                                                               9/10
  Verifying  : zabbix-server-mysql-3.4.13-1.el7.x86_64                                                                                              10/10

Updated:
  zabbix-agent.x86_64 0:4.0.1-1.el7              zabbix-server-mysql.x86_64 0:4.0.1-1.el7              zabbix-web-mysql.noarch 0:4.0.1-1.el7

Dependency Updated:
  zabbix-web.noarch 0:4.0.1-1.el7                                         zabbix-web-japanese.noarch 0:4.0.1-1.el7

Complete!

おしまい!

アップデード後

zabbix_server のバージョンが上がったぞ! というアラートが出て、コメントつけても時間経過しても消えませんでした……。テンプレート(Linux のもの)から Version 変更時の通知用テンプレート、そのトリガに「手動クローズを許可する」ようにして、手動でクローズするようにしました。 これどうやったら自動で消えるんだろーな。