In Zabbix, what is an item, and how do passive and active agent checks differ?
answer
- one metric on one host
- who opens the TCP connection
- agent port versus server port
- Hostname must match the configured host
- outbound-only firewall rules out polling
basics
~20 sA Zabbix item is one configured metric on a host, named by a key. In a passive check the Zabbix server connects to the agent and asks for a value; in an active check the agent connects out and sends.
solid answer
~50 sAn **item** is Zabbix's unit of collection: one metric on one host, defined by an *item key* such as `system.cpu.load[all,avg1]` or `vfs.fs.size[/,pfree]`, plus a type, a value type and an update interval. Every value it produces is stored as history and rolled up into hourly trends. Whether collection is **passive** or **active** is a property of the item's type, not of the agent binary. A passive item makes the Zabbix server open a connection to the agent's listening port, TCP **10050**, and request the key. An active item inverts that: the agent asks the address in its `ServerActive` setting for the list of active items configured for its `Hostname`, collects them on its own schedule, and pushes batched values back to the server's port **10051**. Only the active direction works through a firewall that permits outbound connections only.
code
text · 5 lines# zabbix_agentd.conf
Server=10.4.7.11
ServerActive=10.4.7.11
Hostname=ferry-booking-web-03
RefreshActiveChecks=120go deeper
Be ready to say what a Zabbix item is - one metric on one host, named by a key - and to state which side opens the connection for a passive check and which side opens it for an active one.
Explain the agent settings that select each mode: Server as an allow-list for incoming requests, ServerActive plus a matching Hostname for active checks, and which port each direction uses.
An interviewer expects you to choose per item rather than per host: passive for cheap availability signals the server can watch fail, active for volume and for anything behind a one-way firewall, plus how you detect an active agent that has gone silent.
Own the estate-wide default. Argue what an all-active fleet costs you in liveness signal and what an all-passive one costs in firewall rules and poller capacity, and how you make that choice reviewable rather than decided per team.
## The item: Zabbix's unit of collection Everything Zabbix stores starts as an **item**. An item belongs to exactly one host and is defined by four things: a **key** naming what to collect (`agent.ping`, `system.cpu.load[all,avg1]`, `vfs.fs.size[/,pfree]`, `net.if.in[eth0]`), a **type** saying who produces the value, a **value type** (numeric unsigned, numeric float, character, log or text) deciding how it is stored, and an **update interval**. The key is not free text: its name and bracketed parameters together identify the item on the host, which is how "free space on `/`" and "free space on `/var`" coexist as two separate items. Each value the item yields is written to **history** with a timestamp, and Zabbix separately keeps **trends** — hourly minimum, average, maximum and count per item — so a year-long graph does not have to read raw history. Nothing alerts on an item directly; triggers are configured separately and read the item's history. The item **type** is where the collection mechanism is chosen, and the list is long: Zabbix agent, Zabbix agent (active), SNMP agent, Zabbix trapper, simple check, external check, database monitor, HTTP agent, calculated, dependent item and more. The two that matter for the agent are the first two — and note that passive versus active is a property of the **item type**, not of which agent binary is installed. ## Passive checks: the server asks An item of type **Zabbix agent** is passive. On each update interval a poller process on the Zabbix server or proxy opens a TCP connection to the agent's listening port, **10050**, sends the item key, reads one value back and closes. Two things follow. First, the Zabbix server needs a route to every agent and inbound firewall permission to 10050 on each one. Second, the agent's `Server` configuration parameter is an allow-list of addresses permitted to ask; a request from anywhere else is refused. You can reproduce exactly what the server does with the `zabbix_get` command-line tool, which is the fastest way to prove that a failing item is a network or permission problem rather than a configuration problem in the frontend. ## Active checks: the agent tells An item of type **Zabbix agent (active)** inverts the direction. The agent periodically contacts the address in its `ServerActive` parameter — the Zabbix server or proxy on port **10051** — and asks which active items are configured for the host named in its `Hostname` parameter. The server replies with the list and the intervals, the agent collects on its own schedule, and it pushes accumulated values back to 10051 in batches. Three consequences of that design: 1. **The agent must identify itself.** The `Hostname` in the agent's configuration has to match the host name configured in Zabbix, or the server has no list to hand back and the items never start. This is the most common active-check failure by a wide margin. 2. **The agent holds state.** Because it drives its own schedule it can buffer values locally when the server is unreachable and send them on reconnect, and it can remember a read position in a file — which is why log-file items (`log[]`, `logrt[]`) exist only as active checks. 3. **Configuration changes are not instant.** The agent re-fetches its list on the interval set by `RefreshActiveChecks`, so a newly added active item starts collecting after that delay rather than the moment it is saved. ## Which one survives the network | | Passive (Zabbix agent) | Active (Zabbix agent (active)) | |---|---|---| | Who opens the connection | server or proxy to agent | agent to server or proxy | | Port used | agent's 10050 | server's 10051 | | Firewall requirement | inbound to every host | outbound from every host | | When the link drops | the value is simply missed | agent buffers, sends on reconnect | | Who owns the schedule | the server | the agent | | Cost on the server | a poller occupied per check | batched, cheaper per value | **A firewall that permits outbound connections only leaves active checks as the only option.** That is the everyday case for hosts in a DMZ, in a customer's network, or behind NAT with no reachable address: you cannot connect *to* them, so you let them connect to you. The trade is that you lose the liveness signal a passive check gives away for free — a refused or timed-out connection is itself information — and you have to detect silence explicitly instead. ## Practical consequences Mixing the two on one host is normal and usually right. Keep a cheap availability item passive so the server sees a connection failure the moment the host stops answering, and push everything voluminous — per-filesystem, per-interface, log monitoring — to active so the collection cost sits on the monitored host rather than on a poller. At fleet scale the balance shifts further toward active, because a passive check occupies a server process for the whole round trip while an active one arrives pre-batched and needs only to be accepted. Two operational habits follow. Because active agents choose when to speak, a dead agent looks identical to one with nothing to say unless you monitor for absence deliberately. And because `Hostname` is the join key, renaming a host in the frontend silently breaks its active collection until the agent config matches again.
- Why can Zabbix log-file monitoring items only be configured as active checks?Because the agent has to remember where it stopped reading. A log item tracks a position in the file between collections and sends only what is new since then, and that state lives in the agent, which works only when the agent drives its own schedule. A passive check is a stateless request and response, so the server would have no way to say where to resume from.
- An active Zabbix item on one host has stopped producing values. Where do you look first?Check that the agent's Hostname exactly matches the host name configured in Zabbix, because the server hands back an active-check list keyed by that name. Then confirm the agent can reach the address in ServerActive on the server's port, that the host is monitored rather than disabled, and read the agent log, which reports a refused connection or an empty check list directly.
- What does zabbix_get let you prove that the Zabbix frontend cannot?It runs the same passive request the server would run, from a shell, against the agent's listening port. If it returns the value, the failure is on the server or in the item configuration. If it is refused or times out, the failure is the network path or the agent's Server allow-list. One command isolates the two halves.
Passive checks are a roll call: the server reads out each name and waits for an answer. Active checks are a sign-in sheet: everyone reports to the desk on their own way in.
saying these in an interview costs you the question
- Says passive and active are two different agent binaries rather than item types
- Thinks a passive Zabbix check works through an outbound-only firewall
- Believes the agent's Hostname is cosmetic and need not match the host in Zabbix
- Confuses the agent's listening port with the port the Zabbix server listens on
- Assumes a newly added active item starts collecting the instant it is saved