Zabbix 5.4安装部署教程(含报表功能)

ZABBIX深圳大会召开临近,zabbix良心发布新版zabbix5.4正式版,与小编一起体验下,Zabbix 5.4在经过3个beta版本、2个rc(候选版本)终于发布了,但是其实比较引人关注的为PDF周期报表功能,但要实现该功能需要很复杂的操作。

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图1)

基础环境

系统版本:Rocky Linux 8.3(CentOS8同样也可以)

数据库:MariaDB Server version: 10.3.28-MariaDB MariaDB Server

Zabbix 5.4正式版

一、安装Zabbix源

1.1、Install Zabbix repository

由于刚刚发布,所以国内大部分源是没有及时同步的,只能采用官方源。

[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
获取https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
警告:/var/tmp/rpm-tmp.0hFQYZ: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY
Verifying...                          ################################# [100%]
准备中...                          ################################# [100%]
正在升级/安装...
   1:zabbix-release-5.4-1.el8         ################################# [100%]
[root@localhost ~]# dnf clean all
36 文件已删除

1.2、安装Zabbix server,Web前端,agent

[root@localhost ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
正在查找最快的镜像(7 的主机) done.                 1% [-                                                 ] 136  B/s | 106  B     00:46 ETA
AlmaLinux 8 - BaseOS                                                                                         793 kB/s | 4.4 MB     00:05
AlmaLinux 8 - AppStream                                                                                      2.9 MB/s | 7.2 MB     00:02
AlmaLinux 8 - PowerTools                                                                                     1.2 MB/s | 2.2 MB     00:01
AlmaLinux 8 - Extras                                                                                         2.8 kB/s | 3.6 kB     00:01
Zabbix Official Repository - x86_64                                                                          8.3 kB/s |  16 kB     00:01
Zabbix Official Repository non-supported - x86_64                                                            608  B/s | 1.2 kB     00:01
依赖关系解决。
=============================================================================================================================================
 软件包                              架构           版本                                                  仓库                          大小
=============================================================================================================================================
安装:
 zabbix-agent                        x86_64         5.4.0-8.el8                                           zabbix                       490 k
 zabbix-nginx-conf                   noarch         5.4.0-8.el8                                           zabbix                        20 k
 zabbix-server-mysql                 x86_64         5.4.0-8.el8                                           zabbix                       1.4 M
 zabbix-sql-scripts                  noarch         5.4.0-8.el8                                           zabbix                       4.4 M
 zabbix-web-mysql                    noarch         5.4.0-8.el8                                           zabbix                        18 k
安装依赖关系:
 OpenIPMI-libs                       x86_64         2.0.27-1.el8                                          baseos                       509 k
 fping                               x86_64         3.16-1.el8                                            zabbix-non-supported          51 k
 httpd-filesystem                    noarch         2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1         appstream                     36 k
 mariadb-connector-c                 x86_64         3.1.11-2.el8_3                                        appstream                    199 k
 mariadb-connector-c-config          noarch         3.1.11-2.el8_3                                        appstream                     14 k
 nginx                               x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                    568 k
 nginx-all-modules                   noarch         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     23 k
 nginx-filesystem                    noarch         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     23 k
 nginx-mod-http-image-filter         x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     34 k
 nginx-mod-http-perl                 x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     44 k
 nginx-mod-http-xslt-filter          x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     32 k
 nginx-mod-mail                      x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     63 k
 nginx-mod-stream                    x86_64         1:1.14.1-9.module_el8.3.0+2165+af250afe.alma          appstream                     84 k
 php-bcmath                          x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                     78 k
 php-common                          x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    659 k
 php-fpm                             x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    1.6 M
 php-gd                              x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                     82 k
 php-json                            x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                     72 k
 php-ldap                            x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                     78 k
 php-mbstring                        x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    579 k
 php-mysqlnd                         x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    189 k
 php-pdo                             x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    121 k
 php-xml                             x86_64         7.2.24-1.module_el8.3.0+2010+7c76a223                 appstream                    187 k
 unixODBC                            x86_64         2.3.7-1.el8                                           appstream                    458 k
 zabbix-web                          noarch         5.4.0-8.el8                                           zabbix                       3.3 M
 zabbix-web-deps                     noarch         5.4.0-8.el8                                           zabbix                        19 k
启用模块流:
 httpd                                              2.4
 nginx                                              1.14
 php                                                7.2
事务概要
=============================================================================================================================================
安装  31 软件包
总下载:15 M
安装大小:54 M
确定吗?[y/N]: y
下载软件包:
done.inux 8 - AppStream                             96% [================================================  ] 1.2 kB/s | 6.5 kB     00:00 ETA
(1/31): httpd-filesystem-2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1.noarch.rpm                            131 kB/s |  36 kB     00:00
(2/31): OpenIPMI-libs-2.0.27-1.el8.x86_64.rpm                                                                1.2 MB/s | 509 kB     00:00
(3/31): mariadb-connector-c-3.1.11-2.el8_3.x86_64.rpm                                                        489 kB/s | 199 kB     00:00
(4/31): mariadb-connector-c-config-3.1.11-2.el8_3.noarch.rpm                                                  94 kB/s |  14 kB     00:00
(5/31): nginx-all-modules-1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch.rpm                              472 kB/s |  23 kB     00:00
(6/31): nginx-filesystem-1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch.rpm                               390 kB/s |  23 kB     00:00
(7/31): nginx-mod-http-image-filter-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                    557 kB/s |  34 kB     00:00
(8/31): nginx-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                                          4.3 MB/s | 568 kB     00:00
(9/31): nginx-mod-http-perl-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                            633 kB/s |  44 kB     00:00
(10/31): nginx-mod-http-xslt-filter-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                    618 kB/s |  32 kB     00:00
(11/31): nginx-mod-mail-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                                1.2 MB/s |  63 kB     00:00
(12/31): php-bcmath-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                         902 kB/s |  78 kB     00:00
(13/31): nginx-mod-stream-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64.rpm                              513 kB/s |  84 kB     00:00
(14/31): php-common-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                         4.8 MB/s | 659 kB     00:00
(15/31): php-gd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                             1.2 MB/s |  82 kB     00:00
(16/31): php-json-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                           1.0 MB/s |  72 kB     00:00
(17/31): php-ldap-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                           1.7 MB/s |  78 kB     00:00
(18/31): php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                            5.0 MB/s | 1.6 MB     00:00
(19/31): php-mysqlnd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                        1.0 MB/s | 189 kB     00:00
(20/31): php-pdo-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                            1.8 MB/s | 121 kB     00:00
(21/31): php-xml-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                            2.6 MB/s | 187 kB     00:00
(22/31): unixODBC-2.3.7-1.el8.x86_64.rpm                                                                     2.8 MB/s | 458 kB     00:00
(23/31): php-mbstring-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64.rpm                                       1.4 MB/s | 579 kB     00:00
(24/31): zabbix-nginx-conf-5.4.0-8.el8.noarch.rpm                                                             16 kB/s |  20 kB     00:01
(25/31): zabbix-agent-5.4.0-8.el8.x86_64.rpm                                                                 226 kB/s | 490 kB     00:02
(26/31): zabbix-server-mysql-5.4.0-8.el8.x86_64.rpm                                                          502 kB/s | 1.4 MB     00:02
(27/31): zabbix-web-deps-5.4.0-8.el8.noarch.rpm                                                               82 kB/s |  19 kB     00:00
(28/31): zabbix-web-mysql-5.4.0-8.el8.noarch.rpm                                                              77 kB/s |  18 kB     00:00
(29/31): fping-3.16-1.el8.x86_64.rpm                                                                         212 kB/s |  51 kB     00:00
(30/31): zabbix-sql-scripts-5.4.0-8.el8.noarch.rpm                                                           1.2 MB/s | 4.4 MB     00:03
(31/31): zabbix-web-5.4.0-8.el8.noarch.rpm                                                                   1.1 MB/s | 3.3 MB     00:03
---------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                         1.0 MB/s |  15 MB     00:15
警告:/var/cache/dnf/zabbix-d3df1b2842222a01/packages/zabbix-agent-5.4.0-8.el8.x86_64.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY
Zabbix Official Repository - x86_64                                                                          1.6 MB/s | 1.7 kB     00:00
导入 GPG 公钥 0xA14FE591:
 Userid: "Zabbix LLC <packager@zabbix.com>"
 指纹: A184 8F53 52D0 22B9 471D 83D0 082A B56B A14F E591
 来自: /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
确定吗?[y/N]: y
导入公钥成功
警告:/var/cache/dnf/zabbix-non-supported-fd580106adc78ca9/packages/fping-3.16-1.el8.x86_64.rpm: 头V4 DSA/SHA1 Signature, 密钥 ID 79ea5ed4: NOKEY
Zabbix Official Repository non-supported - x86_64                                                            1.3 MB/s | 1.3 kB     00:00
导入 GPG 公钥 0x79EA5ED4:
 Userid: "Zabbix SIA <packager@zabbix.com>"
 指纹: FBAB D5FB 2025 5ECA B22E E194 D13D 58E4 79EA 5ED4
 来自: /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
确定吗?[y/N]: y
导入公钥成功
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                              1/1
  安装    : php-common-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                     1/31
  安装    : zabbix-web-5.4.0-8.el8.noarch                                                                                               2/31
  运行脚本: zabbix-web-5.4.0-8.el8.noarch                                                                                               2/31
  运行脚本: nginx-filesystem-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch                                                        3/31
  安装    : nginx-filesystem-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch                                                        3/31
  安装    : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                             4/31
  运行脚本: nginx-mod-http-image-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                             4/31
  安装    : nginx-mod-http-perl-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                     5/31
  运行脚本: nginx-mod-http-perl-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                     5/31
  安装    : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                              6/31
  运行脚本: nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                              6/31
  安装    : nginx-mod-mail-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                          7/31
  运行脚本: nginx-mod-mail-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                          7/31
  安装    : nginx-all-modules-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch                                                       8/31
  安装    : nginx-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                                   9/31
  运行脚本: nginx-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                                   9/31
  安装    : nginx-mod-stream-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                       10/31
  运行脚本: nginx-mod-stream-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                       10/31
  安装    : php-bcmath-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                    11/31
  安装    : php-gd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                        12/31
  安装    : php-json-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                      13/31
  安装    : php-ldap-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                      14/31
  安装    : php-mbstring-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                  15/31
  安装    : php-pdo-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       16/31
  安装    : php-mysqlnd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                   17/31
  安装    : php-xml-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       18/31
  安装    : fping-3.16-1.el8.x86_64                                                                                                    19/31
  安装    : unixODBC-2.3.7-1.el8.x86_64                                                                                                20/31
  运行脚本: unixODBC-2.3.7-1.el8.x86_64                                                                                                20/31
  安装    : mariadb-connector-c-config-3.1.11-2.el8_3.noarch                                                                           21/31
  安装    : mariadb-connector-c-3.1.11-2.el8_3.x86_64                                                                                  22/31
  运行脚本: httpd-filesystem-2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1.noarch                                                      23/31
  安装    : httpd-filesystem-2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1.noarch                                                      23/31
  安装    : php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       24/31
  运行脚本: php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       24/31
  安装    : zabbix-web-mysql-5.4.0-8.el8.noarch                                                                                        25/31
  安装    : zabbix-web-deps-5.4.0-8.el8.noarch                                                                                         26/31
  安装    : OpenIPMI-libs-2.0.27-1.el8.x86_64                                                                                          27/31
  运行脚本: zabbix-server-mysql-5.4.0-8.el8.x86_64                                                                                     28/31
  安装    : zabbix-server-mysql-5.4.0-8.el8.x86_64                                                                                     28/31
  运行脚本: zabbix-server-mysql-5.4.0-8.el8.x86_64                                                                                     28/31
  安装    : zabbix-nginx-conf-5.4.0-8.el8.noarch                                                                                       29/31
  运行脚本: zabbix-nginx-conf-5.4.0-8.el8.noarch                                                                                       29/31
  安装    : zabbix-sql-scripts-5.4.0-8.el8.noarch                                                                                      30/31
  运行脚本: zabbix-agent-5.4.0-8.el8.x86_64                                                                                            31/31
  安装    : zabbix-agent-5.4.0-8.el8.x86_64                                                                                            31/31
  运行脚本: zabbix-agent-5.4.0-8.el8.x86_64                                                                                            31/31
  运行脚本: php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       31/31
  验证    : OpenIPMI-libs-2.0.27-1.el8.x86_64                                                                                           1/31
  验证    : httpd-filesystem-2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1.noarch                                                       2/31
  验证    : mariadb-connector-c-3.1.11-2.el8_3.x86_64                                                                                   3/31
  验证    : mariadb-connector-c-config-3.1.11-2.el8_3.noarch                                                                            4/31
  验证    : nginx-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                                   5/31
  验证    : nginx-all-modules-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch                                                       6/31
  验证    : nginx-filesystem-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch                                                        7/31
  验证    : nginx-mod-http-image-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                             8/31
  验证    : nginx-mod-http-perl-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                     9/31
  验证    : nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                             10/31
  验证    : nginx-mod-mail-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                         11/31
  验证    : nginx-mod-stream-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64                                                       12/31
  验证    : php-bcmath-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                    13/31
  验证    : php-common-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                    14/31
  验证    : php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       15/31
  验证    : php-gd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                        16/31
  验证    : php-json-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                      17/31
  验证    : php-ldap-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                      18/31
  验证    : php-mbstring-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                  19/31
  验证    : php-mysqlnd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                   20/31
  验证    : php-pdo-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       21/31
  验证    : php-xml-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64                                                                       22/31
  验证    : unixODBC-2.3.7-1.el8.x86_64                                                                                                23/31
  验证    : zabbix-agent-5.4.0-8.el8.x86_64                                                                                            24/31
  验证    : zabbix-nginx-conf-5.4.0-8.el8.noarch                                                                                       25/31
  验证    : zabbix-server-mysql-5.4.0-8.el8.x86_64                                                                                     26/31
  验证    : zabbix-sql-scripts-5.4.0-8.el8.noarch                                                                                      27/31
  验证    : zabbix-web-5.4.0-8.el8.noarch                                                                                              28/31
  验证    : zabbix-web-deps-5.4.0-8.el8.noarch                                                                                         29/31
  验证    : zabbix-web-mysql-5.4.0-8.el8.noarch                                                                                        30/31
  验证    : fping-3.16-1.el8.x86_64                                                                                                    31/31
已安装:
  OpenIPMI-libs-2.0.27-1.el8.x86_64
  fping-3.16-1.el8.x86_64
  httpd-filesystem-2.4.37-30.module_el8.3.0+2171+8bf57d29.alma.1.noarch
  mariadb-connector-c-3.1.11-2.el8_3.x86_64
  mariadb-connector-c-config-3.1.11-2.el8_3.noarch
  nginx-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  nginx-all-modules-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch
  nginx-filesystem-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.noarch
  nginx-mod-http-image-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  nginx-mod-http-perl-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  nginx-mod-http-xslt-filter-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  nginx-mod-mail-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  nginx-mod-stream-1:1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64
  php-bcmath-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-common-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-fpm-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-gd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-json-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-ldap-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-mbstring-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-mysqlnd-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-pdo-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  php-xml-7.2.24-1.module_el8.3.0+2010+7c76a223.x86_64
  unixODBC-2.3.7-1.el8.x86_64
  zabbix-agent-5.4.0-8.el8.x86_64
  zabbix-nginx-conf-5.4.0-8.el8.noarch
  zabbix-server-mysql-5.4.0-8.el8.x86_64
  zabbix-sql-scripts-5.4.0-8.el8.noarch
  zabbix-web-5.4.0-8.el8.noarch
  zabbix-web-deps-5.4.0-8.el8.noarch
  zabbix-web-mysql-5.4.0-8.el8.noarch
完毕!

1.3、创建初始数据库

[root@localhost ~]# yum -y install mariadb-server
上次元数据过期检查:0:08:08 前,执行于 2021年05月19日 星期三 08时45分58秒。
依赖关系解决。
=============================================================================================================================================
 软件包                             架构                版本                                                    仓库                    大小
=============================================================================================================================================
安装:
 mariadb-server                     x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream               16 M
安装依赖关系:
 mariadb                            x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream              6.0 M
 mariadb-common                     x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream               62 k
 mariadb-errmsg                     x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream              233 k
 perl-DBD-MySQL                     x86_64              4.046-3.module_el8.3.0+2064+e7669ff9                    appstream              155 k
安装弱的依赖:
 mariadb-backup                     x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream              6.1 M
 mariadb-gssapi-server              x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream               50 k
 mariadb-server-utils               x86_64              3:10.3.28-1.module_el8.3.0+2177+7adc332a                appstream              1.1 M
启用模块流:
 mariadb                                                10.3
 perl-DBD-MySQL                                         4.046
事务概要
=============================================================================================================================================
安装  8 软件包
总下载:30 M
安装大小:153 M
下载软件包:
(1/8): mariadb-common-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                      217 kB/s |  62 kB     00:00
(2/8): mariadb-errmsg-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                      1.0 MB/s | 233 kB     00:00
(3/8): mariadb-gssapi-server-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                               417 kB/s |  50 kB     00:00
(4/8): mariadb-backup-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                      3.9 MB/s | 6.1 MB     00:01
(5/8): mariadb-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                             3.5 MB/s | 6.0 MB     00:01
(6/8): perl-DBD-MySQL-4.046-3.module_el8.3.0+2064+e7669ff9.x86_64.rpm                                        1.2 MB/s | 155 kB     00:00
(7/8): mariadb-server-utils-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                3.7 MB/s | 1.1 MB     00:00
(8/8): mariadb-server-10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64.rpm                                      3.8 MB/s |  16 MB     00:04
---------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                         5.2 MB/s |  30 MB     00:05
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                              1/1
  安装    : mariadb-common-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               1/8
  安装    : mariadb-errmsg-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               2/8
  安装    : perl-DBD-MySQL-4.046-3.module_el8.3.0+2064+e7669ff9.x86_64                                                                   3/8
  安装    : mariadb-backup-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               4/8
  安装    : mariadb-gssapi-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                        5/8
  安装    : mariadb-server-utils-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                         6/8
  运行脚本: mariadb-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               7/8
  安装    : mariadb-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               7/8
  运行脚本: mariadb-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               7/8
  安装    : mariadb-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                                      8/8
  运行脚本: mariadb-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                                      8/8
  验证    : mariadb-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                                      1/8
  验证    : mariadb-backup-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               2/8
  验证    : mariadb-common-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               3/8
  验证    : mariadb-errmsg-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               4/8
  验证    : mariadb-gssapi-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                        5/8
  验证    : mariadb-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                               6/8
  验证    : mariadb-server-utils-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                                                         7/8
  验证    : perl-DBD-MySQL-4.046-3.module_el8.3.0+2064+e7669ff9.x86_64                                                                   8/8
已安装:
  mariadb-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64                  mariadb-backup-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64
  mariadb-common-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64           mariadb-errmsg-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64
  mariadb-gssapi-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64    mariadb-server-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64
  mariadb-server-utils-3:10.3.28-1.module_el8.3.0+2177+7adc332a.x86_64     perl-DBD-MySQL-4.046-3.module_el8.3.0+2064+e7669ff9.x86_64
完毕!

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图1)

#启动数据库并设置为开机启动
[root@localhost ~]# systemctl start mariadb && systemctl enable mariadb   ##注意这里又是mariadb初始化数据库
Created symlink /etc/systemd/system/mysql.service &rarr; /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service &rarr; /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service &rarr; /usr/lib/systemd/system/mariadb.service.
[root@localhost ~]# mysql_secure_installation    ##首次安装无密码,回车进入即可,除了第一步设置密码,其余全部回车即可
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n]
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n]
 ... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n]
 ... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
初始化完毕!
#创建zabbix所需数据库实例
[root@localhost ~]# mysql -uroot -p
Enter password:******
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.3.28-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> create user zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'zabbix' WITH GRANT OPTION;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]>quit
导入zabbix初始数据库文件
针对ERROR 1046 (3D000) at line 1: No database selected报错,在create.sql.qz里加入use zabbix,如最后一张图
[root@localhost mysql]# vim /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz
第一行添加:use zabbix    esc-wq保存退出
[root@localhost mysql]# zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz  | mysql -uzabbix -pzabbix

1.4、为Zabbix server配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf

[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf
105 DBName=zabbix
121 DBUser=zabbix
129 DBPassword=zabbix     ##大约在129行位置

1.5、为Zabbix前端配置PHP、NGINX

编辑配置文件 /etc/nginx/conf.d/zabbix.conf, uncomment and set 'listen' and 'server_name' directives.

[root@localhost mysql]# vim /etc/nginx/conf.d/zabbix.conf
listen 80;
server_name localhost;     ##添加自己的域名,我这里用IP访问指向本地
##由于nginx默认配置占用80端口,所以需要修改nginx默认配置。
[root@localhost mysql]# vi /etc/nginx/nginx.conf  

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图2)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图3)

1.6、启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启

[root@localhost mysql]# systemctl restart zabbix-server zabbix-agent nginx php-fpm
Job for zabbix-server.service failed because the control process exited with error code.
See "systemctl status zabbix-server.service" and "journalctl -xe" for details.
[root@localhost mysql]# systemctl enable zabbix-server zabbix-agent nginx php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service &rarr; /usr/lib/systemd/system/zabbix-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service &rarr; /usr/lib/systemd/system/zabbix-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service &rarr; /usr/lib/systemd/system/nginx.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service &rarr; /usr/lib/systemd/system/php-fpm.service.
[root@localhost mysql]#

1.7、配置Zabbix前端

连接到新安装的Zabbix前端: http://server_ip_or_name

浏览器直接访问http://172.19.19.100      ##我这里用IP直接访问

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图4)

下一步

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图5)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图6)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图7)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图8)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图9)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图10)

Zabbix安装部分完毕。

二、报表功能配置

2.1、修改Zabbix配置文件

另外需要启用PDF报表的相关功能,报表功能依赖zabbix-web-service和chrome(你没看错是谷歌浏览器)

[root@localhost mysql]# vi /etc/zabbix/zabbix_server.conf
StartReportWriters=3
Example: http://localhost:10053/report
[root@localhost ~]# yum install zabbix-web-service.x86_64 -y
[root@localhost ~]# vim /etc/zabbix/zabbix_web_service.conf
AllowedIP=localhost,::1

[root@master-03 opt]# cat /etc/zabbix/zabbix_web_service.conf | grep -v '#'|grep -v '^$'
LogFile=/var/log/zabbix/zabbix_web_service.log
LogFileSize=0
AllowedIP=localhost,::1
[root@localhost ~]# systemctl start zabbix-web-service.service

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图12)

2.2、安装Google Chrome

如果没有wget,请安装wget工具<dnf -y install wget>,如果安装过程出现超时,请重试就行,目前google浏览器的网址国内没有和谐,可安心下载

[root@localhost mysql]# wget  
--2021-05-19 10:12:02--  https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
正在解析主机 dl.google.com (dl.google.com)... 120.253.253.161
正在连接 dl.google.com (dl.google.com)|120.253.253.161|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:82774736 (79M) [application/x-rpm]
正在保存至: &ldquo;google-chrome-stable_current_x86_64.rpm&rdquo;
google-chrome-stable_current_x86_64 100%[================================================================>]  78.94M  5.14MB/s  用时 14s
2021-05-19 10:12:16 (5.60 MB/s) - 已保存 &ldquo;google-chrome-stable_current_x86_64.rpm&rdquo; [82774736/82774736])
[root@localhost mysql]# dnf -y localinstall google-chrome-stable_current_x86_64.rpm
上次元数据过期检查:1:26:36 前,执行于 2021年05月19日 星期三 08时45分58秒。
依赖关系解决。
=============================================================================================================================================
 软件包                                   架构                     版本                                 仓库                            大小
=============================================================================================================================================
安装:
 google-chrome-stable                     x86_64                   90.0.4430.212-1                      @commandline                    79 M
安装依赖关系:
 liberation-fonts                         noarch                   1:2.00.3-7.el8                       baseos                          20 k
 liberation-serif-fonts                   noarch                   1:2.00.3-7.el8                       baseos                         609 k
 mesa-vulkan-drivers                      x86_64                   20.1.4-1.el8                         appstream                      4.2 M
 vulkan-loader                            x86_64                   1.2.154.1-1.el8                      appstream                      117 k
事务概要
=============================================================================================================================================
安装  5 软件包
总计:84 M
总下载:4.9 M
安装大小:266 M
下载软件包:
(1/4): liberation-fonts-2.00.3-7.el8.noarch.rpm                                                               83 kB/s |  20 kB     00:00
(2/4): vulkan-loader-1.2.154.1-1.el8.x86_64.rpm                                                              973 kB/s | 117 kB     00:00
(3/4): liberation-serif-fonts-2.00.3-7.el8.noarch.rpm                                                        1.2 MB/s | 609 kB     00:00
(4/4): mesa-vulkan-drivers-20.1.4-1.el8.x86_64.rpm                                                           4.9 MB/s | 4.2 MB     00:00
---------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                         1.0 MB/s | 4.9 MB     00:04
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  准备中  :                                                                                                                              1/1
  安装    : vulkan-loader-1.2.154.1-1.el8.x86_64                                                                                         1/5
  安装    : mesa-vulkan-drivers-20.1.4-1.el8.x86_64                                                                                      2/5
  安装    : liberation-serif-fonts-1:2.00.3-7.el8.noarch                                                                                 3/5
  安装    : liberation-fonts-1:2.00.3-7.el8.noarch                                                                                       4/5
  运行脚本: google-chrome-stable-90.0.4430.212-1.x86_64                                                                                  5/5
  安装    : google-chrome-stable-90.0.4430.212-1.x86_64                                                                                  5/5
  运行脚本: google-chrome-stable-90.0.4430.212-1.x86_64                                                                                  5/5
错误:无法创建 事务 锁定于 /var/lib/rpm/.rpm.lock (资源暂时不可用)
错误:/tmp/google.sig.7mOtNY:导入密钥 1 失败。
错误:无法创建 事务 锁定于 /var/lib/rpm/.rpm.lock (资源暂时不可用)
错误:/tmp/google.sig.7mOtNY:导入密钥 2 失败。
  验证    : liberation-fonts-1:2.00.3-7.el8.noarch                                                                                       1/5
  验证    : liberation-serif-fonts-1:2.00.3-7.el8.noarch                                                                                 2/5
  验证    : mesa-vulkan-drivers-20.1.4-1.el8.x86_64                                                                                      3/5
  验证    : vulkan-loader-1.2.154.1-1.el8.x86_64                                                                                         4/5
  验证    : google-chrome-stable-90.0.4430.212-1.x86_64                                                                                  5/5
已安装:
  google-chrome-stable-90.0.4430.212-1.x86_64     liberation-fonts-1:2.00.3-7.el8.noarch     liberation-serif-fonts-1:2.00.3-7.el8.noarch
  mesa-vulkan-drivers-20.1.4-1.el8.x86_64         vulkan-loader-1.2.154.1-1.el8.x86_64
完毕!

2.3、报表功能

需要添加仪表盘,(Previous day为前一天),目前支持的颗粒度为天、周、月、年,发送的PDF需要有邮箱媒介支持,另外用户需要有周期报表的权限(如下图二)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图13)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图14)

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图15)

2.4、报表功能异常问题

2.4.1、未设置前端url

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图16)

解决办法为:

找到管理选项--一般--其他(英文路径为Administration--General--Other)里的Frontend URL,填入安装路径,也就是访问zabbix的路径。

2.4.2、媒介未设置

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图17)

解决办法为:管理--用户--单机用户名--报警媒介--选择类型--添加完毕

【手册】Zabbix发布新版Zabbix 5.4安装部署教程(含报表功能)(图18)

2.4.3、告警管理器被禁用

这种报错就是zabbix-server配置文件web-services部分未配置。

至此,Zabbix深圳大会临近时间,发布新版Zabbix5.4正式版,详细zabbx安装部署完成,根据这个手册新手一次成功体验新版zabbix5.4问题不大。