Zabbix for Mere Mortals
A computer rarely fails all at once. A disk fills a percent at a time, a service slows down over a week, a certificate expires on a Sunday. Zabbix is the program that watches for that kind of trouble: you run it on one machine, it keeps asking your other machines (and itself) small questions — how full is this disk, how busy is this processor, is this service answering — and it remembers every answer. When an answer crosses a line you drew, Zabbix raises a problem, and it can tell someone: an email, a message in a chat channel, a ticket in a tracker. The asking, the remembering and the telling are all one system, with a web page to run it from and an API — a way for programs, not just people, to drive it.
This guide explains how Zabbix fits together, how to install the server with a PostgreSQL database, and how to make it do the whole job once, end to end, on one small machine watching itself: a host added, eighty-two checks inherited from a single template, real numbers arriving, a problem raised by a file the lab controlled, the problem on the web page, and the alert machinery trying to deliver the news. Then it hands you the API and shows the same work done in text, where every step can be checked.
The lab behind this guide ran the real thing: Zabbix 7.0.32 (the long-term support line), the official packages for Ubuntu 24.04, with PostgreSQL 16 as its database and PHP 8.3 serving the web frontend, all on loopback on one small Linux machine. Against it the lab created the database and imported the schema, started the server and an agent, logged in through the browser form and through the API, added a host, watched live processor and memory numbers arrive, invented a gauge it could control, fired a trigger with it, saw the problem appear in the web interface, set an action to send an email about it, created a limited user and watched that user be refused, and broke things on purpose: a wrong password, a question the agent could not answer, a first attempt the database was too small for.
What the lab could not do, it did not
fake. The lab's network is a sandbox:
no second machine to watch, no working
outbound mail, no SNMP device to poll.
So this guide proves everything against
the one machine it had, and teaches the
rest — proxies that watch other
networks, SNMP devices, discovery that
finds machines by itself — from the
documentation, labelled as such wherever
it appears. The email alert is the
honest example: the alert was created,
the send was attempted, and the failure
is quoted word for word, because the
last hop out of the lab does not exist.
criteria.md keeps the full ledger of
what was run and what was only read.
One line belongs up front, because a monitoring system sees a great deal: it knows when your machines are busy, what runs on them, when they are used and when they are idle — and that is a picture of the people who use them, too. Run Zabbix on machines you own or are plainly authorised to watch, give its accounts and API tokens the care you give passwords, and keep its database for as long as you have a reason to. Chapter 1 returns to this; no procedure in this guide depends on forgetting it.
What this guide covers
- What Zabbix is — the mental model: questions asked on a schedule, answers remembered, lines that turn answers into problems, and problems that can tell someone
- The moving parts — the server, the database, the agents, the web frontend, and the API — and which part holds what
- Installing Zabbix — the official packages, the PostgreSQL database, the schema import, and the server's first start
- Your first login — the web page, the default Admin account, and the API login that every later chapter uses
- Hosts and templates — what a host is, why you link a template instead of copying checks, and the eighty-two items one link brings
- Items — asking for numbers — agent checks, the keys that name them, values arriving, and a gauge of your own made from one line of agent configuration
- Triggers and problems — the expression that watches a value, the problem it raises, the web page that shows it, and the recovery when the value comes back
- Telling someone — media and actions — media types, the address on the user, the action that connects a problem to a message, and the alert that proves the chain ran
- Users, groups and roles — who may see what: user groups grant the view, roles grant the powers, and a limited user tested both ways
- The API — Zabbix without the browser — JSON-RPC with curl and a small helper, creating hosts, items, triggers and users in text, and reading the errors it answers with
- Recipes — watch a second machine, add a check of your own to a template, make a problem notify a group, and check a whole installation in one pass
- The neighbours — Prometheus and Grafana, Beszel, Nagios and its kin, and the simple uptime checkers: what each does that Zabbix doesn't, and vice versa
- Limits — one server is one point of failure, a database that grows unless it is housekept, delivery that depends on other people's systems, and the rest of the honest list
- Troubleshooting — the frontend that cannot reach its database, the agent parameter that does not exist, the password the policy refuses, the trigger expression that will not parse, and the traps this guide's lab fell into
- Glossary — the terms, collected in one place
What it doesn't cover
Running Zabbix in high-availability clusters or spread across sites with proxies — chapter 12 is honest that the single server this guide builds is a single point of failure, and the distributed machinery is described, not run. Watching network hardware over SNMP, and discovery that finds and enrols machines by itself, are likewise taught from the documentation: the lab had neither a device nor a second machine. Making alerts actually arrive in your inbox or chat is your mail and chat systems' business — this guide proves the alert leaves Zabbix's machinery correctly addressed, and its lab could go no further.
How to use this guide
Read chapter 1 for the model, and
chapter 2 before installing anything —
knowing which part holds what turns
later confusion into a named problem.
Chapter 3 installs; chapter 4 logs in
twice, once per door. Chapters 5 to 7
are the core loop — host, items,
trigger, problem — and chapter 7 is the
one to read slowly: every later claim
in the guide is that loop wearing
different clothes. The lab's
transcripts live in
zabbix-lab/transcripts/; its
configuration files, its gauge file and
its small API helper zapi.py are
beside them in zabbix-lab/, so every
claim can be re-run, not just read.
Part of the series
This guide is one of the For Mere Mortals guides: plain-language guides to the tools programmers and makers use.
Related guides:
- Prometheus and Grafana for Mere Mortals
- Beszel for Mere Mortals
- Watching Your System for Mere Mortals
- PostgreSQL for Mere Mortals
License
The writing in this guide is licensed under CC BY 4.0. Code examples and lab scripts are licensed under the MIT License.