Set up Zabbix alerts in ITSI
Set up an integration with Zabbix and send alerts from Zabbix to ITSI.
Prerequisites
-
You must have Zabbix version 6.0 or later installed.
-
You must be an admin for Zabbix.
-
Create a HEC endpoint and token to set up the webhook.
Overview
Zabbix uses Media types to define notification channels. The Webhook media type allows running a JavaScript snippet on each alert, which sends event data to Splunk HEC. This media type is attached to a user, creating an action to trigger the webhook when a Zabbix alert is sent. The same
Configure Zabbix webhook
-
Log in to Zabbix.
-
Navigate to Alerts then Media types, or Administration then Media types.
-
Select Create media type.
-
Set the Type to Webhook.
-
Fill in the following fields:
-
Name: Splunk HEC
-
Type: Webhook
-
-
In the Parameters section, add key-value pairs passed as a JSON object to the script. Replace placeholders with your HEC URL and token:
Name Value alert_message {ALERT.MESSAGE} alert_subject {ALERT.SUBJECT} event_date {EVENT.DATE} event_id {EVENT.ID} event_name {EVENT.NAME} event_recovery_date {EVENT.RECOVERY.DATE} event_recovery_time {EVENT.RECOVERY.TIME} event_severity {EVENT.SEVERITY} event_source {EVENT.SOURCE} event_tags {EVENT.TAGS} event_time {EVENT.TIME} event_update_action {EVENT.UPDATE.ACTION} event_update_date {EVENT.UPDATE.DATE} event_update_message {EVENT.UPDATE.MESSAGE} event_update_status {EVENT.UPDATE.STATUS} event_update_time {EVENT.UPDATE.TIME} event_update_user {EVENT.UPDATE.USER} event_value {EVENT.VALUE} host_ip {HOST.IP} host_name {HOST.NAME} TOKEN <your-hec-token> trigger_description {TRIGGER.DESCRIPTION} trigger_id {TRIGGER.ID} URL https://<splunk-host>:8088/services/collector Note: {EVENT.VALUE} is1for a problem and0for a recovery.{EVENT.SOURCE}indicates whether the alert came from a trigger, discovery rule, or other source. -
In the Script tab, paste the following JavaScript:When an alert is triggered, Zabbix bundles your defined parameters into a structured JSON string, which the script then unpacks into a readable object for processing. This object is forwarded through the HTTP Event Collector (HEC) with the sourcetype set toJSON
try { var params = JSON.parse(value); if (!params.URL || !params.TOKEN) { throw 'Missing required parameters URL or TOKEN'; } var req = new HttpRequest(); req.addHeader('Authorization: Splunk ' + params.TOKEN); req.addHeader('Content-Type: application/json'); var data = JSON.stringify({ event: params, sourcetype: 'zabbix:alert' }); var response = req.post(params.URL, data); if (req.getStatus() != 200) { throw 'Failed to send data to Splunk HEC: ' + req.getStatus() + ' Response: ' + response; } return 'OK'; } catch (error) { Zabbix.log(4, '[ Splunk HEC Webhook ] Error: ' + error); throw 'Splunk HEC Webhook failed: ' + error; }zabbix:alert, ensuring your data is correctly categorized.
Create an action
-
Navigate to Alerts then Actions then Trigger actions.
-
Select Create action.
-
On the Action tab:
-
Set Name to
Send alerts to Splunk -
Set any Conditions you want (e.g., filter by host group, minimum severity). Leave conditions empty to catch all triggers.
-
- On the Operations tab, select Add.
- Under Operations:
- Set Operation type to
Send message - Send to users: Select the user from Step 2.
- Set Send only to:
Splunk HEC
- Set Operation type to
- (Optional) Add a Recovery operations entry so Splunk receives a recovery event when the problem is resolved.
- Select Add to save the action.
Test Zabbix alert
Splunk HEC. Verify that a test event appears in Splunk. The following example displays a sample event:
{
"alert_message": "High CPU utilization detected on webserver01.example.com. Current usage: 95.5%",
"alert_subject": "Problem: High CPU on webserver01.example.com",
"event_date": "2025.10.03",
"event_id": "1234567890123456789",
"event_name": "CPU utilization is too high ( > 90% for 5m )",
"event_recovery_date": "",
"event_recovery_time": "",
"event_severity": "High",
"event_source": "Trigger",
"event_tags": "application:web,environment:production",
"event_time": "10:30:00",
"event_update_action": "",
"event_update_date": "",
"event_update_message": "",
"event_update_status": "",
"event_update_time": "",
"event_update_user": "",
"event_value": "1",
"host_ip": "192.168.1.100",
"host_name": "webserver01.example.com",
"trigger_description": "Checks if the average CPU utilization over the last 5 minutes exceeds 90%.",
"trigger_id": "9876543210987654321"
}