这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.

5 从二进制包安装

来自 Zabbix 官方仓库

Zabbix SIA 为以下系统提供了官方的 RPM 和 DEB 软件包:

适用于各种操作系统发行版的 yum/dnf、apt 和 zypper 仓库的软件包文件可以在 Zabbix 官方仓库 上获取。

一些操作系统发行版(特别是基于 Debian 的发行版)提供了他们自己的 Zabbix 软件包。请注意,这些软件包 不是 由 Zabbix 支持的。第三方的 Zabbix 软件包可能过时,并且可能缺少最新的功能和错误修复。建议只使用来自 Zabbix 官方仓库 的官方软件包。如果您之前使用过非官方的 Zabbix 软件包,请查看有关从操作系统仓库升级 Zabbix 软件包的说明

Package installation notes

The following notes apply to all systems:

The following notes apply to RHEL and its derivatives:

SELinux configuration

Zabbix uses socket-based inter-process communication. On systems where Security-Enhanced Linux (SELinux) is enabled, you may need to add SELinux rules to allow Zabbix create/use UNIX domain sockets in the SocketDir directory. Socket files are used by Zabbix server (alerter, preprocessing, IPMI) and Zabbix proxy (IPMI), and they're present while the process is running.

Having SELinux enabled in enforcing mode, execute the following commands to enable communication between Zabbix frontend and server:

For RHEL 7 (and later), AlmaLinux, CentOS Stream, Oracle Linux, Rocky Linux 8 (and later):

setsebool -P httpd_can_connect_zabbix on

If the database is accessed over the network (including localhost for PostgreSQL), also allow Zabbix frontend to connect to the database:

setsebool -P httpd_can_network_connect_db on

For RHEL prior to 7:

setsebool -P httpd_can_network_connect on
       setsebool -P zabbix_can_network on

After applying SELinux settings, restart Apache:

systemctl restart httpd

Optionally, you can install a pre-defined zabbix-selinux-policy package from The Zabbix Official Repository. This package is provided for all supported OS versions to simplify Zabbix deployment and prevent users from turning off SELinux because of the configuration complexity.

For maximum security, it is recommended to set custom SELinux settings.

The zabbix-selinux-policy package contains a basic SELinux policy, allowing Zabbix to create and use sockets and enabling HTTPd connection to PostgreSQL (used by frontend).

The source zabbix_policy.te file contains the following rules:

module zabbix_policy 1.2;
       
       require {
           type zabbix_t;
           type zabbix_port_t;
           type zabbix_var_run_t;
           type postgresql_port_t;
           type httpd_t;
           class tcp_socket name_connect;
           class sock_file { create unlink };
           class unix_stream_socket connectto;
       }
       
       #============= zabbix_t ==============
       allow zabbix_t self:unix_stream_socket connectto;
       allow zabbix_t zabbix_port_t:tcp_socket name_connect;
       allow zabbix_t zabbix_var_run_t:sock_file create;
       allow zabbix_t zabbix_var_run_t:sock_file unlink;
       allow httpd_t zabbix_port_t:tcp_socket name_connect;
       
       #============= httpd_t ==============
       allow httpd_t postgresql_port_t:tcp_socket name_connect;

Debuginfo packages

Debuginfo packages contain debugging symbols for Zabbix binaries. They are not required for normal installation or operation but are useful for advanced troubleshooting.

To enable the zabbix-debuginfo repository:

  • On RHEL 7, edit /etc/yum.repos.d/zabbix.repo and set enabled=1 for the zabbix-debuginfo section:
[zabbix-debuginfo]
       name=Zabbix Official Repository debuginfo - $basearch
       baseurl=http://repo.zabbix.com/zabbix/7.2/stable/rhel/7/$basearch/debuginfo/
       enabled=1
       gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
       gpgcheck=1
  • On SUSE, edit /etc/zypp/repos.d/zabbix.repo and set enabled=1 for the zabbix-debuginfo section:
[zabbix-debuginfo]
       name=Zabbix Official Repository debuginfo
       type=rpm-md
       baseurl=https://repo.zabbix.com/zabbix/7.2/stable/sles/15/x86_64/debuginfo/
       gpgcheck=1
       gpgkey=https://repo.zabbix.com/zabbix/7.2/stable/sles/15/x86_64/debuginfo/repodata/repomd.xml.key
       enabled=0
       update=1

Once enabled, install the packages:

  • On RHEL, install a single package with debug information for all Zabbix components:
dnf install zabbix-debuginfo
  • On SUSE, install component-specific debuginfo packages:
zypper install zabbix-<component>-debuginfo