Learn Zabbix - Hosts, Host Groups & Templates
Episode 5 of 23

Learn Zabbix - Hosts, Host Groups & Templates

This episode covers host management in Zabbix: adding target hosts, linking host groups for organization and permissions, and leveraging the template library so hundreds of items and triggers install automatically. You'll also get to know HostMetadata for auto-registration.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

Episode 4 proved that agents can send data. But on the frontend side, that data has no "home" yet — because the target host hasn't been registered in Zabbix. Episode 5 bridges these two worlds: you'll add the host in the frontend, organize them into host groups, and — most importantly — link templates so dozens of items and triggers are installed without manual work.

If episode 4 is about connecting the network, episode 5 is about organizing the configuration. The mindset you build here — template-first, tidy organization, consistent naming — will determine how easily your Zabbix is managed at the scale of hundreds of hosts.

Adding Hosts in the Frontend

The Host Form in the Configuration Menu

Hosts are added via the Configuration → Hosts → Create host menu. There are three sections you must fill in:

  • Host name: the host name, which must exactly match the agent's Hostname.
  • Groups: at least one host group must be linked.
  • Interfaces: the agent's IP or DNS address, on port 10050.
Basic host form fields
Host name:  host-target-01
Groups:     Linux servers
Agent interface: 192.168.1.20 : 10050

Once the host is created and a template is linked, wait a few intervals until data comes in. Check the Monitoring → Latest data menu filtered by host name to confirm values are being collected.

Names Must Be Consistent

One golden rule: the host name in the frontend must be identical to the agent's Hostname. If they differ, active check data won't match and the host will look like "No data" even when the agent is healthy. For passive checks, this mismatch doesn't surface because the server queries by address — but still keep consistency to avoid confusion.

Host Groups: Organization and Permissions

Grouping Infrastructure

A host group is a way to organize hosts — for example Linux servers, Database servers, Web servers, or Network devices. Host groups aren't just cosmetic: they're the foundation for RBAC permissions and filtering in dashboards and reports.

Create a host group via the API
curl -s -X POST http://localhost/api_jsonrpc.php \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"hostgroup.create","params":{"name":"Linux servers"},"id":1,"auth":"<token>"}'

The command curl -s -X POST http://localhost/api_jsonrpc.php calls the Zabbix API — we'll fully dissect API authentication and automation in episode 14. For now, just understand that a host group is a programmable object, not just a label.

Hierarchy and Naming Conventions

Design host groups with a clear hierarchy. Here's a pattern commonly used by production teams:

  • Linux/Production
  • Linux/Development
  • Network/Edge
  • Cloud/AWS

With this pattern, per-host-group permissions are easy to manage: a development team only sees its own group, and reports can be filtered per environment without touching other data.

Templates: Reusable Configuration Packages

The Template Concept

A template is a collection of items, triggers, graphs, and actions defined once, then linked to many hosts. Instead of manually creating 40 CPU, memory, disk, and network items for each host, you link one Linux template and everything is installed.

Each host can link many templates. If two templates produce items with the same key, the one linked later wins. This matters when you create custom templates in episode 18.

The Official Template Library

Zabbix ships an extremely broad official template library — from Linux by Zabbix agent active and Linux by Zabbix agent for operating systems, to templates for PostgreSQL, Nginx, Docker, and Kubernetes. These templates are the best starting point because they already include mature items, triggers, and graphs.

Check available templates via the API
curl -s -X POST http://localhost/api_jsonrpc.php \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"template.get","params":{"output":["host"]},"id":1,"auth":"<token>"}'

The command template.get returns the list of templates on the server. Pick the matching template, link it to the host, and let Zabbix do the rest.

Custom Templates

When your needs go beyond the official library, create your own template: duplicate a built-in template, add custom items and triggers, then test on one host before rolling out to many. We'll build custom templates and agent2 plugins in depth in episode 18.

Tip

Always prefer official templates before creating your own. Official templates are maintained by the Zabbix team, updated with every release, and already tested against various operating system versions.

Auto-registration and HostMetadata

Rolling Out Agents with HostMetadata

For large-scale rollouts, adding hosts one by one is inefficient. The solution: configure HostMetadata in the agent, then let the server register hosts automatically via auto-registration.

HostMetadata in zabbix_agent2.conf
ServerActive=192.168.1.10
HostMetadata=system.uname:Linux
HostMetadataItem=system.uname

The parameter HostMetadataItem=system.uname makes the agent pull a value from a system item — for example the kernel name — and send it as metadata during auto-registration. The server then uses this metadata to decide which template to link. We'll cover the full auto-registration and discovery mechanism in episode 11.

The Auto-registration Flow

When an active agent first contacts the server, the server receives the hostname and metadata, matches them against the auto-registration action conditions, then automatically: creates the host, links the host group, and attaches the template. Without touching the frontend, a new host is fully configured immediately.

Closing

Episode 5 organized the configuration side: hosts are added in the frontend with consistent names, host groups provide organization and permissions, templates cut down the manual work of dozens of items, and HostMetadata opens the path to automated provisioning.

Key takeaways:

  • The host name in the frontend must exactly match the agent's Hostname.
  • Host groups are the foundation of RBAC permissions and report filtering.
  • A template is a reusable collection of items, triggers, and graphs.
  • Prefer the official template library before creating custom templates.
  • HostMetadata and auto-registration streamline provisioning of new hosts.

In the next episode 6 we'll discuss items, data collection, and preprocessing — the item types from agent to SNMP and HTTP, understanding keys, and preprocessing to normalize raw data with JavaScript, JSONPath, and multipliers.

Learn Zabbix - Hosts, Host Groups & Templates | Learn Zabbix