Last updated Nov 2, 2026.
A small Zabbix webhook media type posts each problem and recovery to OpsPing in the Alertmanager shape: a problem opens one alert per Zabbix event, the recovery closes it, and Zabbix trigger severity maps to P1–P4.
Why not Zabbix's built-in Opsgenie media type?
Zabbix ships an Opsgenie webhook media type (source ↗) whose API URL is a parameter, so it can be pointed elsewhere. We don't recommend pointing it at OpsPing: after sending, the script checks delivery with Opsgenie's GET /v2/alerts/requests/{id} endpoint, which OpsPing doesn't implement, and on update operations it can call unacknowledge by alias, which OpsPing's Opsgenie-compatible API doesn't support. Expect failed or retried actions in Zabbix if you try it. The custom media type below avoids both calls.
Setup
- In OpsPing, open Integrations and create an inbound integration with the OpsPing API Key source type, which accepts native OpsPing JSON and auto-detected Alertmanager-style payloads. Name it after the sending system (the name becomes the alert
source), pick a default service, and copy its webhook URL (https://api.opsping.com/v2/webhooks/inbound/<id>/<token>). Treat the URL as a secret: the token in it is the credential. - In Zabbix, go to Alerts → Media types → Create media type, set Type to Webhook, and name it OpsPing.
- Add these parameters (see Zabbix's webhook media type docs ↗ and macro reference ↗):
| Parameter name | Value |
|---|---|
opsping_url | the OpsPing webhook URL |
event_value | {EVENT.VALUE} |
event_update_status | {EVENT.UPDATE.STATUS} |
event_id | {EVENT.ID} |
event_nseverity | {EVENT.NSEVERITY} |
alert_subject | {ALERT.SUBJECT} |
alert_message | {ALERT.MESSAGE} |
host_name | {HOST.NAME} |
trigger_id | {TRIGGER.ID} |
zabbix_url | {$ZABBIX.URL} |
- Paste the script below into Script. On the Message templates tab add Problem and Problem recovery templates; their subject and body become
{ALERT.SUBJECT}and{ALERT.MESSAGE}. - Set the global macro
{$ZABBIX.URL}to your frontend URL (Administration → Macros) if you want alerts to link back to the Zabbix event. - Add the OpsPing media to a Zabbix user (any send-to value), then create or edit a trigger action whose Operations and Recovery operations send to that user via the OpsPing media type.
- Use Test on the media type with real values, or trigger a test problem, and confirm the alert opens and closes in OpsPing.
var params = JSON.parse(value);
if (!params.opsping_url || !/^https:\/\//.test(params.opsping_url)) {
throw 'Set opsping_url to the OpsPing integration webhook URL (https://api.opsping.com/v2/webhooks/inbound/...).';
}
// Acknowledgements and comments (update operations) are not forwarded.
if (params.event_value === '1' && params.event_update_status === '1') {
return 'skipped update';
}
var severities = {'0': 'warning', '1': 'info', '2': 'warning', '3': 'error', '4': 'critical', '5': 'critical'};
var entry = {
status: params.event_value === '0' ? 'resolved' : 'firing',
fingerprint: 'zabbix-' + params.event_id,
labels: {
alertname: params.alert_subject,
severity: severities[params.event_nseverity] || 'warning',
instance: params.host_name
},
annotations: {description: params.alert_message}
};
if (params.zabbix_url && params.trigger_id) {
entry.generatorURL = params.zabbix_url.replace(/\/+$/, '') +
'/tr_events.php?triggerid=' + params.trigger_id + '&eventid=' + params.event_id;
}
var request = new HttpRequest();
request.addHeader('Content-Type: application/json');
if (params.HTTPProxy) {
request.setProxy(params.HTTPProxy);
}
var response = request.post(params.opsping_url, JSON.stringify({alerts: [entry]}));
var status = request.getStatus();
Zabbix.log(4, '[OpsPing webhook] HTTP ' + status + ': ' + response);
if (status < 200 || status >= 300) {
throw 'OpsPing returned HTTP ' + status + ': ' + response;
}
return 'OK';
Field mapping
| Zabbix value | OpsPing alert |
|---|---|
{ALERT.SUBJECT} | Message (truncated to 130 characters) |
{EVENT.ID} | Alias zabbix-<event id>; the recovery carries the problem's event ID, so it closes the same alert |
{EVENT.NSEVERITY} | Priority: Disaster and High → P1, Average → P2, Warning and Not classified → P3, Information → P4 |
{HOST.NAME} | Entity |
{ALERT.MESSAGE} | Description |
{$ZABBIX.URL} + trigger/event IDs | Details link back to the Zabbix event page |
Notes
- Acknowledgements and comments made in Zabbix (update operations) are skipped. Acknowledge in OpsPing, which is where on-call works the alert.
- The script throws on any non-2xx response, so Zabbix records the failure and applies the media type's retry settings.
- OpsPing's inbound webhook accepts up to 300 requests a minute per integration.
FAQ
Can I use Zabbix's Opsgenie media type with OpsPing?
Its URL is configurable, but we don't recommend it: the script checks delivery through Opsgenie's request-status endpoint, which OpsPing doesn't implement, and can call unacknowledge by alias, which OpsPing doesn't support. Use the custom webhook media type on this page.
Do Zabbix recoveries close the OpsPing alert?
Yes. Recovery operations send {EVENT.VALUE} 0 with the original problem's {EVENT.ID}, so the script sends a resolved entry with fingerprint zabbix-<event id> and OpsPing closes that alert.
Which Zabbix versions does this work with?
Zabbix versions with webhook media types and the {EVENT.UPDATE.STATUS} macro (Zabbix 5.0 and later). Menu names here follow current Zabbix 7.x; older versions place Media types under Administration.