Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 37 ยท Scaling and Proxies

Proxies and Active versus Passive Checks

Learn when to deploy Zabbix proxies, how active and passive modes differ for agents and proxies, proxy groups and buffering, encryption, and firewall planning.

A Zabbix proxy collects data on behalf of the server. It is the tool for remote sites with slow or unreliable links, for networks behind firewalls, and for spreading load. Two related ideas confuse beginners: active versus passive for agents, and active versus passive for proxies. This lesson separates them, then covers deployment, buffering and firewall rules. Zabbix is not runnable on this site, so configuration is shown as read-only text and the stand-ins model the data flow.

Active versus passive agents

  • Passive check: the server (or proxy) connects to the agent on TCP 10050 and asks for a value. The agent answers. The connection goes toward the monitored host.
  • Active check: the agent connects out to the server on TCP 10051, downloads its list of checks, runs them locally and sends the results. The connection goes from the monitored host. If the server is down, the agent buffers values (BufferSize, BufferSend).

Active checks are the better default for large environments: the server does not poll, work is spread across agents, and hosts behind NAT work without inbound rules. Passive checks are simpler for firewalls that allow only inbound connections to hosts, and they are the way to run "Execute now" and zabbix_get tests.

In the agent configuration:

INI
# zabbix_agentd.conf
Server=10.0.0.5            # who may ask passively
ServerActive=10.0.0.5      # where to send active data
Hostname=web01             # must match the host name in Zabbix for active checks

The Hostname value is the glue for active checks: if it does not exactly match the host name in the frontend, the server answers "host not found" and nothing is collected. The HostMetadata setting lets a new agent register itself (see network discovery and autoregistration).

What a proxy does

A proxy has its own small database (SQLite, MySQL or PostgreSQL). It receives its configuration from the server, performs checks, stores the values and sends them in batches. Features:

  • It supports most check types, discovery, and remote commands.
  • It does not evaluate triggers, send notifications or store long-term data; the server still does that.
  • It buffers data for the period set in ProxyOfflineBuffer (hours) when the server is unreachable.
  • Hosts are assigned to a proxy in their host configuration ("Monitored by proxy").

Active versus passive proxies

  • Active proxy (default): the proxy connects to the server on 10051, requests configuration, and sends data. Only outbound connections from the site are needed.
  • Passive proxy: the server connects to the proxy on 10051. Use it when policy forbids outbound connections from the remote site but allows inbound.

In Zabbix 7.0 the terms changed to the proxy operating mode (active or passive) in the proxy settings; the config file entries ProxyMode=0 (active) and ProxyMode=1 (passive) in older versions are replaced by the frontend setting plus Server= and Hostname= in zabbix_proxy.conf.

INI
# zabbix_proxy.conf (active proxy)
Server=zbx-server.example.com
Hostname=proxy-berlin
ProxyOfflineBuffer=24
ConfigFrequency=300
DataSenderFrequency=1

Proxy groups and load balancing (7.0 and later)

A proxy group contains several proxies. Hosts monitored "by proxy group" are spread across the proxies in it, and when one proxy goes offline, its hosts move automatically to the others. The group has a minimum number of online proxies and a failover period. Agents in active mode use a list of proxies in ServerActive (separated by commas or semicolons depending on the mode) to follow the move. This replaces manual spreading and complicated external clusters.

Encryption and trust

Between server, proxy and agent, set TLS with pre-shared keys or certificates (TLSConnect, TLSAccept, TLSPSKIdentity, TLSPSKFile). In the frontend, the host or proxy "Encryption" tab decides what connections are accepted. Without it, values and commands travel in clear text. Always protect the connection between a proxy and the server across the internet.

Firewall cheat sheet

Direction Port Purpose
Server to agent 10050 Passive checks
Agent to server or proxy 10051 Active checks, sender data
Proxy to server 10051 Active proxy data and configuration
Server to passive proxy 10051 Configuration and data requests
Browser to frontend 80/443 The web interface
Server to database 3306 / 5432 Storage

Stand-in: buffer sizing

When a link fails, the proxy stores values locally. This Python calculation estimates how many values a proxy must hold and how much disk that needs.

Python Proxy offline buffer (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

It becomes clear why ProxyOfflineBuffer=24 on a proxy with 50,000 items needs real disk, and why the database for a busy proxy should not be SQLite.

Stand-in: simulate active proxy failover

A tiny simulation of the idea behind proxy groups: hosts are assigned to online proxies, and when one proxy dies they are redistributed.

Python Proxy group redistribution (Python stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Troubleshooting proxies

  • Proxy shows "never seen": check Hostname= in zabbix_proxy.conf against the frontend name, and the port 10051 connectivity.
  • Data arrives late: look at the "Zabbix proxy health" template items (queue size, data lag).
  • After upgrading the server, proxies stop: proxies must usually be of the same major version, or one version behind in the supported range. Check the compatibility table of your version.
  • Duplicate hosts: never assign the same host to two proxies.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In an active agent check, which side starts the connection?

    Active agents connect out to the server on port 10051.
  2. 2. What must match exactly for active checks to work?

    The server identifies active agents by the Hostname value.
  3. 3. What do proxies NOT do?

    Triggers, events and alerts stay on the server.
  4. 4. When is a passive proxy appropriate?

    A passive proxy is polled by the server, so it needs only inbound access.

Summary

  • Active agents connect out; passive agents are polled. Prefer active at scale.
  • Proxies collect and buffer data and forward it; the server evaluates triggers and alerts.
  • Proxies are active (connect out) or passive (are polled); proxy groups add load sharing and failover.
  • Use TLS between components and plan firewall rules around ports 10050 and 10051.

Next: Database and Housekeeping