Monitoring

Zabbix Integration

Overview

A ready-made Zabbix template that polls the SecondDNS health API via HTTP Agent every 5 minutes, extracts zone counters with JSONPath, and fires triggers when zones go stale or unreachable.

Prerequisites

  • Zabbix Server 6.0+ (HTTP Agent support)
  • A SecondDNS API key (Dashboard → API Key)
  • A host in Zabbix to attach the template to (can be the Zabbix server itself)

1. Download the template

curl -O https://raw.githubusercontent.com/seconddns/dns_integrations/main/zabbix_templates/seconddns_health.yaml

Source: github.com/seconddns/dns_integrations/zabbix_templates

2. Import into Zabbix

  1. Go to Configuration → Templates → Import
  2. Select the downloaded seconddns_health.yaml
  3. Click Import

3. Configure macros

Link the template to a host, then set the macros:

{$SECONDDNS_API_URL}https://seconddns.com (default, change if self-hosted)
{$SECONDDNS_API_KEY}Your API key (stored as Secret text in Zabbix)

4. What you get

Items

ItemTypeInterval
Zone health JSONHTTP Agent5m
Total zonesDependent (JSONPath)
Synced zonesDependent (JSONPath)
Stale zonesDependent (JSONPath)
Master unreachableDependent (JSONPath)
Nagios outputHTTP Agent5m

Triggers

TriggerSeverity
Zone(s) staleWarning
Zone(s) master unreachableHigh
Health API not responding (30 min)High

How it works

  1. The master item (seconddns.health.json) fetches GET /api/health/zones every 5 minutes
  2. Dependent items extract $.summary.total, $.summary.synced, etc. via JSONPath — no extra HTTP calls
  3. Triggers evaluate the counters: if stale > 0 → Warning, if masterUnreachable > 0 → High
  4. The Nagios output item (seconddns.health.nagios) fetches ?format=nagios for human-readable text in the "Latest data" view