Skip to main content

Overview

Zabbix is an open-source enterprise monitoring solution for networks and applications. EasyContact receives alerts from Zabbix via webhook media type, automatically creating incidents from trigger events.
This integration works with Zabbix 4.4+ which supports native webhook media types.

Setup Instructions

1

Create Integration in EasyContact

  1. Go to ConfigurationIntegrations
  2. Click Add Integration
  3. Select Zabbix as the type
  4. Enter a name (e.g., “Production Zabbix”)
  5. Save and copy the webhook URL
2

Create Media Type in Zabbix

  1. Go to AdministrationMedia Types
  2. Click Create media type
  3. Set Type to Webhook
  4. Enter Name: “EasyContact”
3

Configure Webhook Parameters

Add the following parameters:
NameValue
URLYour EasyContact webhook URL
HTTPProxy(optional) Your proxy if needed
Set the script (see below)
4

Create Action

  1. Go to ConfigurationActions
  2. Create a new action for trigger events
  3. Add operation with media type “EasyContact”
5

Test the Integration

Trigger a test alert in Zabbix and verify it appears in EasyContact

Webhook Script

Use this script in your Zabbix webhook media type:
var params = JSON.parse(value),
    req = new HttpRequest(),
    resp;

req.addHeader('Content-Type: application/json');

var payload = {
    event_id: params.event_id,
    trigger_id: params.trigger_id,
    trigger_name: params.trigger_name,
    trigger_severity: params.trigger_severity,
    trigger_status: params.trigger_status,
    host_name: params.host_name,
    host_ip: params.host_ip,
    item_name: params.item_name,
    item_value: params.item_value,
    event_date: params.event_date,
    event_time: params.event_time,
    event_tags: params.event_tags,
    trigger_description: params.trigger_description,
    trigger_url: params.trigger_url
};

resp = req.post(params.URL, JSON.stringify(payload));

if (req.getStatus() !== 200) {
    throw 'Response code: ' + req.getStatus();
}

return true;

Webhook Parameters

Configure these parameters in the Zabbix media type:
ParameterMacroDescription
event_id{EVENT.ID}Unique event identifier
trigger_id{TRIGGER.ID}Trigger identifier
trigger_name{TRIGGER.NAME}Trigger name/title
trigger_severity{TRIGGER.SEVERITY}Severity level
trigger_status{TRIGGER.STATUS}PROBLEM or OK
host_name{HOST.NAME}Affected host
host_ip{HOST.IP}Host IP address
item_name{ITEM.NAME}Item that triggered
item_value{ITEM.VALUE}Current value
event_date{EVENT.DATE}Event date
event_time{EVENT.TIME}Event time
event_tags{EVENT.TAGS}Event tags
trigger_description{TRIGGER.DESCRIPTION}Description
trigger_url{TRIGGER.URL}Link to trigger

Field Mapping

EasyContact automatically maps Zabbix fields:
Zabbix FieldEasyContact Field
event_id / eventidEvent ID
trigger_nameTitle
trigger_descriptionDescription
trigger_statusStatus (PROBLEM → problem, OK → ok)
trigger_severitySeverity
host_name / hostnameHost
host_ipHost IP
item_name / applicationService
host_groupEnvironment
event_tagsTags

Severity Mapping

Zabbix uses numeric and text severity levels:
Zabbix ValueZabbix NameEasyContact Severity
5DisasterCritical
4HighHigh
3AverageWarning
2WarningWarning
1InformationInfo
0Not classifiedInfo

Custom Mapping

Override the default mapping if needed:
{
  "severityMapping": {
    "sourceField": "trigger_severity",
    "mappings": {
      "disaster": "critical",
      "high": "critical",
      "average": "high",
      "warning": "warning",
      "information": "info",
      "not_classified": "info"
    },
    "default": "warning"
  }
}

Status Handling

Zabbix StatusEasyContact StatusAction
PROBLEMProblemCreates/updates incident
OKOKResolves incident
Recovery events (OK status) automatically resolve the corresponding incident.

Tags Support

Zabbix tags are captured in two formats:

Native Format (Zabbix 5.0+)

{
  "tags": [
    {"tag": "environment", "value": "production"},
    {"tag": "team", "value": "platform"}
  ]
}

Legacy Format

{
  "event_tags": "environment:production,team:platform"
}
Both formats are automatically parsed and added to the incident tags.

Example Payload

{
  "event_id": "12345",
  "trigger_id": "67890",
  "trigger_name": "High CPU usage on {HOST.NAME}",
  "trigger_severity": "high",
  "trigger_status": "PROBLEM",
  "host_name": "web-server-01",
  "host_ip": "192.168.1.100",
  "item_name": "CPU utilization",
  "item_value": "95%",
  "event_date": "2024.01.15",
  "event_time": "10:30:00",
  "event_tags": "environment:production,team:platform",
  "trigger_description": "CPU usage is above 90% for 5 minutes",
  "trigger_url": "https://zabbix.example.com/triggers/67890"
}

Enrichment Examples

Add context to all Zabbix alerts:
{
  "enrichment": {
    "tags.source": "zabbix",
    "tags.environment": "production",
    "tags.datacenter": "dc1",
    "owner": "infrastructure-team"
  }
}

Troubleshooting

  1. Verify the webhook URL is correct in Zabbix media type
  2. Check Zabbix can reach the EasyContact API (no firewall blocking)
  3. Test the webhook script manually in Zabbix
  4. Review Zabbix action logs for errors
  1. Check if Zabbix sends numeric (0-5) or text severity
  2. Configure appropriate severity mapping
  3. View webhook samples to see actual values
  1. Verify recovery operations are enabled in Zabbix action
  2. Check the trigger_status field is included in payload
  3. Ensure event_id matches between PROBLEM and OK events
  1. Add {HOST.NAME} and {HOST.IP} macros to webhook parameters
  2. Verify the macros resolve correctly in Zabbix

Best Practices

Add tags in Zabbix for better routing and filtering in EasyContact. Tags like environment, team, and service help with escalation routing.
Add {TRIGGER.URL} to help responders quickly navigate to Zabbix for more details.
Enable recovery operations to automatically resolve incidents when the problem clears.
Use Information or Warning severity triggers for initial testing to avoid unnecessary escalations.