Skip to content

Zabbix → Notifly

Zabbix can do everything except one thing — reliably reach a human at night. Emails get lost, and an SMS gateway is yet another thing to maintain. Notifly accepts Zabbix events natively: one media type of the Webhook type — and problems arrive as push notifications with a priority based on the trigger severity, while recoveries arrive quietly.

You need Zabbix 6.0 or newer (on 5.x, replace HttpRequest with CurlHttpRequest).

Create a channel in the admin panel, e.g. zabbix, and copy its channel token (prefix A).

Alerts → Media types → Create media type, type Webhook, name Notifly. Parameters:

NameValue
notifly_urlhttps://api.notifly.ru/integrations/zabbix
notifly_token{ALERT.SENDTO}
subject{ALERT.SUBJECT}
message{ALERT.MESSAGE}
severity{EVENT.NSEVERITY}
status{EVENT.VALUE}
update{EVENT.UPDATE.STATUS}
event_id{EVENT.ID}
host{HOST.NAME}
trigger{EVENT.NAME}
trigger_id{TRIGGER.ID}
url{$ZABBIX.URL}/tr_events.php?triggerid={TRIGGER.ID}&eventid={EVENT.ID}
tags{EVENT.TAGSJSON}

Script:

var params = JSON.parse(value);
var url = params.notifly_url,
token = params.notifly_token;
delete params.notifly_url;
delete params.notifly_token;
var req = new HttpRequest();
req.addHeader('Content-Type: application/json');
req.addHeader('X-Notifly-Key: ' + token);
var resp = req.post(url, JSON.stringify(params));
if (req.getStatus() < 200 || req.getStatus() >= 300) {
throw 'Notifly: HTTP ' + req.getStatus() + ': ' + resp;
}
return 'OK';

On the Message templates tab, add Problem, Problem recovery and Problem update templates — the default ones are enough. Without templates Zabbix won’t send anything (No message defined for media type). Set the {$ZABBIX.URL} macro in Administration → Macros — then the notification includes a link to the event.

  1. Users → user → Media → Add: type Notifly, Send to — the channel token. Different users can have tokens of different channels — the media type stays the same.
  2. Alerts → Actions → Trigger actions: an operation that sends via Notifly, plus recovery and update operations if you need them.
Zabbix eventNotifly priority
problem, Disaster10
problem, High8
problem, Average6
problem, Warning5
problem, Information3
problem, Not classifiedchannel default priority
recovery2 (quiet)
update (ack, comment…)3

The title is {ALERT.SUBJECT}, the text is {ALERT.MESSAGE} plus a link to the event. Details and all extras.zabbix fields are in the receiver documentation.

  • Turn on delivery in the channel settings: an unread Disaster after 5 minutes — a phone call, after 15 — an incident in PagerDuty or an alert in Opsgenie. Read the push — the re-sending stops.
  • Quiet hours with a threshold of 8 let High and Disaster through at night, while Average and below arrive in the morning digest.
  • For scheduled maintenance, create a maintenance window on the zabbix channel — problems will arrive silently and without escalation.
  • No SMS gateway or scripts on the Zabbix server — just the standard media type.
  • Priority by severity: Disaster is loud, Information is quiet, recovery doesn’t wake you.
  • One media type for everyone: different users and groups get their own channels via Send to.
  • Split channels by environment (zabbix-prod, zabbix-stage) and enable escalation only for production.
  • If you already have a media type from Zabbix’s official webhook templates, you can adapt it by changing only the URL and the script: the receiver also understands their parameter names (alert_subject, event_nseverity, host_name…).