Learn Zabbix - Advanced Templates & Integrations
Series/Learn Zabbix/Episode 18
Episode 18 of 23

Learn Zabbix - Advanced Templates & Integrations

This episode covers integrations and advanced templates: official webhooks for PagerDuty, Slack, Teams, and Jira, pushing data to Prometheus, custom agent2 plugins and Python custom checks, plus YAML template import-export.

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

Introduction

Zabbix doesn't operate alone. In real architectures, Zabbix sits alongside on-call platforms, ticketing systems, and other observability stacks. Episode 18 covers two capabilities that make Zabbix a good ecosystem citizen: integrations with external services and advanced templates for needs not covered by the official library.

In episode 8 you touched webhooks. This episode goes deeper: official integrations with on-call and ticketing platforms, plus a pattern for sending metrics to Prometheus. In the second part, you build on the template foundation from episode 5 — creating custom plugins and custom checks that are truly your own.

Official Webhook Integrations

On-Call and Chat Platforms

Zabbix provides official media types for PagerDuty, Slack, Microsoft Teams, Telegram, and VictorOps. Each just needs to be configured with a token or webhook URL from the service. PagerDuty, for example, maps Zabbix severity to PagerDuty incident severity and automatically creates an incident when a problem appears.

PagerDuty media parameters
PagerDuty service key / routing key
Integration key from the PagerDuty service

When a High alarm fires, PagerDuty receives a payload containing the host, trigger, and severity — then handles on-call rotation and escalation on the PagerDuty side.

Jira and ServiceNow

To connect problems with workflows, Zabbix provides Jira and ServiceNow integrations. When a problem occurs, a ticket is automatically created; when the problem recovers, the ticket is closed. This removes the manual double work between monitoring and ticketing. Make sure the Jira token has permission to create issues in the target project before enabling the integration.

Tip

When configuring integrations, test in a staging environment first. Most integration failures aren't in Zabbix, but in a wrongly scoped token or a payload that doesn't match the target service's expectations.

Pushing to Prometheus

Zabbix as a Metric Source

Modern observability architectures often place Prometheus as the primary metrics store. Zabbix can act as a source: metrics collected by Zabbix are pushed to Prometheus via remote write or a scrape endpoint. Zabbix internal items are also available for export, so Prometheus sees Zabbix's own health status.

Zabbix to Prometheus push flow
Zabbix collection → remote write / scrape endpoint → Prometheus

With this pattern, teams already using Prometheus and Grafana can still take advantage of Zabbix's agent-based strengths without replacing their metrics stack.

Advanced Templates and Custom Checks

Custom Agent2 Plugins

Agent2 has a plugin-based architecture. Plugins are written in Go and loaded as binary plugins — configured via the Plugins.<name> parameters in zabbix_agent2.conf:

Agent2 plugin configuration
Plugins.MyPlugin.System.Path=/usr/lib/zabbix/plugins/myplugin
Plugins.MyPlugin.Timeout=3

The parameter Plugins.MyPlugin.System.Path tells agent2 where the plugin binary lives. Agent2 plugins are the right path for high-performance collection in Go.

After placing the binary at that path, restart agent2 so the process picks up the plugin. Verify with zabbix_agent2 --print Plugins.MyPlugin to confirm the plugin appears in the loaded list.

Custom Checks with Python and zabbix_sender

For more flexible needs, write a Python script and send the result with zabbix_sender — exactly the pattern you learned in episode 4. Here's a simple example script that measures something custom:

PythonCustom check with zabbix_sender
import subprocess
import time
 
value = "42"
cmd = [
    "zabbix_sender", "-z", "192.168.1.10", "-p", "10051",
    "-s", "host-target-01", "-k", "custom.check", "-o", value,
]
subprocess.run(cmd)

The script above sends the value 42 for the key custom.check. With zabbix_sender at the end of the script, any calculation result on the host can enter Zabbix as an item — this path opens up endless custom monitoring possibilities. Run the script periodically via cron, and the result appears as a new item every interval; make sure the key you use is already defined as an item on the target host so the value actually shows up.

YAML Template Import-Export

Zabbix templates can be exported as YAML files — the best way to share, version, and migrate templates between environments:

Export a template via the API
curl -s -X POST http://localhost/api_jsonrpc.php \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"configuration.export","params":{"options":{"templates":["<templateid>"]},"format":"yaml"},"id":1,"auth":"<token>"}'

The command curl -s -X POST http://localhost/api_jsonrpc.php calls configuration.export to download the template as YAML. The resulting file can be re-imported on another server and reviewed as part of a pull request.

Mature Template Practices

Some habits that keep a template library healthy:

  • Versioning: keep all template YAML files in git with clear commit messages.
  • One template, one responsibility: separate OS, application, and custom checks.
  • Document macros inside the template so users know which values to fill in.
  • Test a template on one host before linking it to the whole fleet.

Closing

Episode 18 connected Zabbix with the ecosystem: official webhook integrations for on-call and ticketing, pushing metrics to Prometheus, custom agent2 plugins and Python custom checks, and YAML template import-export for git-based workflows.

Key takeaways:

  • Official integrations wrap webhooks for PagerDuty, Slack, Teams, and Telegram.
  • Jira and ServiceNow connect problems with ticketing workflows.
  • Zabbix can act as a metric source for Prometheus.
  • Agent2 plugins use Go; flexible custom checks use Python and zabbix_sender.
  • YAML template export supports versioning and migration between environments.

In the next episode 19 we'll discuss observability: log monitoring and business metrics — log and logrt items for log parsing, fail2ban-style log analysis, and business services with SLI/SLO and weighted service metrics.

Learn Zabbix - Advanced Templates & Integrations | Learn Zabbix