1 Red Hat 企业版 Linux

Packages are available with either MySQL/PostgreSQL database and Apache/Nginx web server support.

Zabbix agent packages and utilities Zabbix get and Zabbix sender are available on Zabbix Official Repository for RHEL 9, , RHEL 7, and .

Zabbix Official Repository provides fping, iksemel and libssh2 packages as well. These packages are located in the non-supported directory.

See installation instructions per platform in the download page for:

  • installing the repository
  • installing server/agent/frontend
  • creating initial database, importing initial data
  • configuring database for Zabbix server
  • configuring PHP for Zabbix frontend
  • configuring Zabbix frontend

If you want to run Zabbix agent as root, see .

Zabbix web service process, which is used for scheduled report generation, requires Google Chrome browser. The browser is not included into packages and has to be installed manually.

使用时序数据库导入数据

使用 TimescaleDB,除了 PostgreSQL 的导入命令外,还需运行:

· # cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix

只有 Zabbix 服务器支持 TimescaleDB。

SELinux 配置

Zabbix 使用基于套接字的进程间通信。 在启用 SELinux 的系统上,可能需要添加 SELinux 规则以允许 Zabbix 在 SocketDir 目录中创建/使用 UNIX 域套接字。 当前套接字文件由服务器(告警器、预处理、IPMI)和代理(IPMI)使用。 套接字文件是持久的,这意味着它们在进程运行时存在。

在强制模式下启用 SELinux 状态后,您需要执行以下命令以启用 Zabbix 前端和服务器之间的通信:

RHEL 7 及更高版本:

· # setsebool -P httpd_can_connect_zabbix on · 如果可以通过网络访问数据库(包括 PostgreSQL 中的“localhost”),您也需要允许 Zabbix 前端连接到数据库: · # setsebool -P httpd_can_network_connect_db on

7 之前的 RHEL:

前端和 SELinux 配置完成后,重启 Apache Web 服务器:

· # service httpd restart

In addition, Zabbix provides the zabbix-selinux-policy package as part of source RPM packages for and RHEL 7. This package provides a basic default policy for SELinux and makes zabbix components work out-of-the-box by 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:

This package has been created to prevent users from turning off SELinux because of the configuration complexity. It contains the default policy that is sufficient to speed up Zabbix deployment and configuration. For maximum security level, it is recommended to set custom SELinux settings.

添加所需的存储库后,您可以通过运行以下命令安装 Zabbix 代理:

· # dnf install zabbix-proxy-mysql zabbix-sql-scripts

将命令中的“mysql”替换为“pgsql”以使用 PostgreSQL,或替换为“sqlite3”以使用 SQLite3(仅限代理)。

“zabbix-sql-scripts”包包含 Zabbix 服务器和 Zabbix 代理的所有支持的数据库管理系统的数据库模式,并将用于数据导入。

创建数据库

Zabbix 代理的单独数据库。

Zabbix server 和 Zabbix proxy 不能使用同一个数据库。 如果它们安装在同一台主机上,则代理数据库必须具有不同的名称。

导入数据

导入初始schema:

· # cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql -uzabbix -p zabbix

对于 PostgreSQL(或 SQLite)的代理:

为 Zabbix 代理配置数据库

编辑 zabbix_proxy.conf:

· # vi /etc/zabbix/zabbix_proxy.conf · DBHost=localhost · DBName=zabbix · DBUser=zabbix · DBPassword=<password>

在 Zabbix 代理的 DBName 中,使用与 Zabbix 服务器不同的数据库。

在 DBPassword 中使用 MySQL 的 Zabbix 数据库密码; PostgreSQL 的 PostgreSQL 用户密码。

在 PostgreSQL 中使用 。 您可能希望保留默认值设置 (或 IP 地址),但这会使PostgreSQL 使用网络套接字连接到 Zabbix。 有关说明,请参阅 SELinux 配置 (/manual/installation/install_from_packages/rhel#selinux_configuration)。

启动Zabbix代理进程

要启动 Zabbix 代理进程并使其在系统启动时启动:

· # service zabbix-proxy start · # systemctl enable zabbix-proxy

前端配置

Zabbix 代理没有前端; 它只与 Zabbix 服务器通信。

只有在以下情况下才需要安装 Java 网关 您想要监视 JMX 应用程序。 Java网关是轻量级的,不需要数据库。

添加所需的存储库后,您可以通过运行以下命令安装 Zabbix Java 网关:

· # dnf install zabbix-java-gateway

继续 了解有关配置和运行 Java 网关的更多详细信息。

Debuginfo packages are currently available for RHEL versions 9, 7, 6 and 5.

To enable debuginfo repository, edit /etc/yum.repos.d/zabbix.repo file. Change to for zabbix-debuginfo repository.

This single package contains debug information for all binary Zabbix components.