Zabbix Documentation 4.0 (current)| In development:5.0 (devel)| Unsupported:

User Tools

Site Tools

This translation is older than the original page and might be outdated. See what has changed.



This is an old revision of the document!

3 Proxy



Zabbix proxy 是一个可以从一个或多个受监控设备采集监控数据并将信息发送到 Zabbix server 的进程,主要是代表 Zabbix server 工作。 所有收集的数据都在本地缓冲,然后传输到 proxy 所属的 Zabbix server。

Zabbix proxy is a process that may collect monitoring data from one or more monitored devices and send the information to the Zabbix server, essentially working on behalf of the server. All collected data is buffered locally and then transferred to the Zabbix server the proxy belongs to.

部署代理是可选的,但可能非常有利于分担单个 Zabbix server 的负载。 如果只有代理采集数据,则 Zabbix server 上的处理会减少 CPU 和磁盘 I/O 的开支。

Deploying a proxy is optional, but may be very beneficial to distribute the load of a single Zabbix server. If only proxies collect data, processing on the server becomes less CPU and disk I/O hungry.

Zabbix proxy 是无需本地管理员即可集中监控远程位置、分支机构和网络的理想解决方案。

A Zabbix proxy is the ideal solution for centralized monitoring of remote locations, branches and networks with no local administrators.

Zabbix proxy 需要使用独立的数据库。

Zabbix proxy requires a separate database.

值得注意的是,Zabbix proxy 支持 SQLite、MySQL和PostgreSQL 作为数据库。使用 Oracle 或 DB2 需要您承担一定的风险,并且可能,例如,在自动发现规则中的 返回值
Note that databases supported with Zabbix proxy are SQLite, MySQL and PostgreSQL. Using Oracle or IBM DB2 is at your own risk and may contain some limitations as, for example, in return values of low-level discovery rules.

详见:在分布式环境中使用 Zabbix proxy

See also: Using proxies in a distributed environment

Proxy 进程

Proxy process

If installed as package

Zabbix proxy 进程以守护进程(Deamon)运行。Zabbix proxy 的启动可以通过执行以下命令来完成:

Zabbix proxy runs as a daemon process. The proxy can be started by executing:

shell> service zabbix-proxy start

上述命令在大多数的 GNU/Linux 系统下都可以正常完成。如果是其他系统,你可能要尝试以下命令来运行:

This will work on most of GNU/Linux systems. On other systems you may need to run:

shell> /etc/init.d/zabbix-proxy start

类似的,Zabbix proxy 的停止、重启、查看状态,则需要执行以下命令:

Similarly, for stopping/restarting/viewing status of Zabbix proxy, use the following commands:

shell> service zabbix-proxy stop
shell> service zabbix-proxy restart
shell> service zabbix-proxy status
Start up manually

如果以上操作均无效,您可能需要手动启动,找到 Zabbix proxy 二进制文件的路径并且执行:

If the above does not work you have to start it manually. Find the path to the zabbix_proxy binary and execute:

shell> zabbix_proxy

您可以将以下命令行参数用于 Zabbix proxy:

You can use the following command line parameters with Zabbix proxy:

-c --config <file>              配置文件路径
-R --runtime-control <option>   执行管理功能
-h --help                       帮助
-V --version                    显示版本号

-c --config <file>              path to the configuration file
-R --runtime-control <option>   perform administrative functions
-h --help                       give this help
-V --version                    display version number

运行时机制的控制不支持 OpenBSD 和 NetBSD 系统。
Runtime control is not supported on OpenBSD and NetBSD.

使用命令行参数运行 Zabbix proxy 的示例::

Examples of running Zabbix proxy with command line parameters:

shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf
shell> zabbix_proxy --help
shell> zabbix_proxy -V
Runtime control

Runtime control options:

config_cache_reloadReload configuration cache. Ignored if cache is being currently loaded.
Active Zabbix proxy will connect to the Zabbix server and request configuration data.
housekeeper_executeStart the housekeeping procedure. Ignored if the housekeeping procedure is currently in progress.
log_level_increase[=<target>]Increase log level, affects all processes if target is not - Process identifier (1 to 65535)
process type - All processes of specified type (e.g., poller)
process type,N - Process type and number (e.g., poller,3)
log_level_decrease[=<target>]Decrease log level, affects all processes if target is not specified.

Allowed range of PIDs for changing the log level of a single Zabbx process is from 1 to 65535. On systems with large PIDs <process type,N> target option can be used for changing the log level of a single process.

Example of using runtime control to reload the proxy configuration cache:

shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R config_cache_reload

Example of using runtime control to trigger execution of housekeeper

shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R housekeeper_execute

Examples of using runtime control to change log level:

Increase log level of all processes:
shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R log_level_increase

Increase log level of second poller process:
shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R log_level_increase=poller,2

Increase log level of process with PID 1234:
shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R log_level_increase=1234

Decrease log level of all http poller processes:
shell> zabbix_proxy -c /usr/local/etc/zabbix_proxy.conf -R log_level_decrease="http poller"
Process user

Zabbix proxy is designed to run as a non-root user. It will run as whatever non-root user it is started as. So you can run proxy as any non-root user without any issues.

If you will try to run it as 'root', it will switch to a hardcoded 'zabbix' user, which must be present on your system. You can only run proxy as 'root' if you modify the 'AllowRoot' parameter in the proxy configuration file accordingly.

Configuration file

See the configuration file options for details on configuring zabbix_proxy.

Supported platforms

Zabbix proxy runs on the same list of supported platforms as Zabbix server.


Note that the proxy requires a UTF-8 locale so that some textual items can be interpreted correctly. Most modern Unix-like systems have a UTF-8 locale as default, however, there are some systems where that may need to be set specifically.