# Zabbix

### Prerequisites: <a href="#prerequisites" id="prerequisites"></a>

This section explains on how to integrate and ingest alerts from Zabbix monitoring tool into CloudFabrix AIOPs platform.&#x20;

Zabbix supports alert notifications via email, sms, script or webhook. CloudFabrix AIOPs platform uses webhook notification method from Zabbix to receive and ingest the alerts or events.

### **Create Webhook for incoming alerts from Zabbix:** <a href="#create-webhook-for-incoming-alerts-from-dynatrace" id="create-webhook-for-incoming-alerts-from-dynatrace"></a>

**Step 1:** Login to cfxDimensions through web-browser UI (as Project Admin user)

**Step 2:** Click on ‘OIA (Ops Intelligence & Analytics)’ app

**Step 3:** Edit on an existing Project and click on 'Configure Project'

**Step 4:** Click on ‘Alerts’ (left menu)

**Step 5:** Under 'Alert Endpoints' tab, Click on ‘**+**’ button to add a new Alert source

**Step 6:** Select 'Endpoint Role' as Source

**Step 7:** Enter Zabbix alert source 'Name'

**Step 8:** Enter Description for Zabbix alert source

**Step 9:** Under 'Event Type' section, select 'Default Zabbix Alerts'

**Step 10:** Under 'Endpoint Type' section, select 'Webhook with Basic Authentication'

**Step 11:** For 'Hostname or IP address', enter FQDN DNS Name or IP Address of cfxDimension platform. This is used within the Webhook URL.

**Step 12:** For 'Timezone' select appriopriate timezone of incoming alerts from Zabbix. (By default, it is set to UTC, which means, it expects the incoming alert timestamp is in UTC)

**Step 13:** Protocol, Port, URI and Security Token are optional and not required

**Step 14:** Enter 'Username' and 'Password' to enable HTTP Basic authentication for Webhook. Leave empty to disable HTTP Basic authentication.

**Step 15:** Click on 'Save' to create Webhook based alert endpoint for Zabbix alerts.

**Step 16:** Edit the newly created alert endpoint for Zabbix alerts and click on 'Enable' to activate it.

**Step 17:** Edit the newly created alert endpoint for Zabbix alerts and click on 'Webhook URL' to and view and copy it.

### **Configure Zabbix for Alert notifications over a Webhook:** <a href="#create-webhook-for-incoming-alerts-from-dynatrace" id="create-webhook-for-incoming-alerts-from-dynatrace"></a>

**Step 1:** Login to Zabbix monitoring tool through web-browser UI

![](/files/-MCDeKOxba9ctiyyXViS)

**Step 2:** On left menu, expand 'Administration' and click on 'Media types'

![](/files/-MCFAiPSZ8VtYUiSAfgh)

**Step 3:** Click on 'Create media type'

![](/files/-MCFBGGV6A8RbwcrDHTA)

**Step 4:** Click on ‘Media type’, Enter name for the Webhook and select 'Type' as 'Webhook' from the drop down.

![](/files/-MCG5rz_5GQ924eY7DWl)

**Step 5:** As highlighted in the above screen, add the below parameters.

1. Alert\_Date  => {EVENT.DATE}
2. Alert\_HostAddress => {HOST.IP}
3. Alert\_Hostname => {HOST.NAME}
4. Alert\_RecoveryDate => {EVENT.RECOVERY.DATE}
5. Alert\_RecoveryTime => {EVENT.RECOVERY.TIME}
6. Alert\_RecoveryName => {EVENT.RECOVERY.NAME}
7. Alert\_ServiceDescription  => {EVENT.NAME}
8. Alert\_ServiceEventId => {EVENT.ID}
9. Alert\_ServiceOutput => {EVENT.OPDATA}
10. Alert\_ServiceState => {EVENT.SEVERITY}
11. Alert\_Time => {EVENT.TIME}
12. Alert\_Status => {EVENT.STATUS}
13. Alert\_Message => {ALERT.MESSAGE}
14. Alert\_WebHookURL => {ALERT.SENDTO}

**Step 6:** Edit the 'Script' field and add the below Java script

```
var params = JSON.parse(value),
req = new CurlHttpRequest(),
resp;
req.AddHeader('Content-Type: application/json');
//req.AddHeader('Authorization: Basic <base64encoded - username:password>');
//Below example when HTTP Basic authentication is used for Webhook, 
//Username: cfxuser, Password: cfxuser
//req.AddHeader('Authorization: Basic Y2Z4dXNlcjpjZnh1c2Vy');

var params = JSON.parse(value);
payload = {};
payload.Alert_ServiceEventId = params.Alert_ServiceEventId;
payload.Alert_HostName = params.Alert_HostName;
payload.Alert_HostAddress = params.Alert_HostAddress;
payload.Alert_Date = params.Alert_Date;
payload.Alert_Time = params.Alert_Time;
payload.Alert_ServiceState = params.Alert_ServiceState;
payload.Alert_ServiceDescription = params.Alert_ServiceDescription;
payload.Alert_ServiceOutput = params.Alert_ServiceOutput;
payload.Alert_Message = params.Alert_Message;
payload.Alert_RecoveryDate = params.Alert_RecoveryDate;
payload.Alert_RecoveryTime = params.Alert_RecoveryTime;
payload.Alert_RecoveryName = params.Alert_RecoveryName;
payload.Alert_Status = params.Alert_Status;
resp = req.Post(params.Alert_WebHookURL,
JSON.stringify(payload)
    );
return resp;

```

**Step 7:** Click on 'Apply' to save the Script

**Step 8:** Make sure 'Enabled' is check-box is checked.

**Step 9:** Click on 'Message Templates' tab and click on 'Add' as show in the below screen

![](/files/-MCFgRHA3qPGiqZAlpPC)

**Step 10:** From 'Message Type' drop down menu, select 'Problem', Enter Subject as 'Problem: {EVENT.NAME}, leave 'Message' as blank and click on 'Add'

![](/files/-MCFh7sqAvgT6YmtqSjI)

**Step 11:** Click on 'Add' to add another Message Template. From 'Message Type' drop down menu, select 'Problem recovery', Enter Subject as 'Resolved in {EVENT.DURATION}: {EVENT.NAME}, leave 'Message' as blank and click on 'Add'

![](/files/-MCFkgoDfxuj1AtdqO0t)

**Step 12:** Click on 'Add' to add and save the Webhook Media Type.

![](/files/-MCFmtpzOWoN-Mlr1KKJ)

**Step 13:** On left menu, expand 'Administration' and click on 'User groups' to add a new user group with read-only permissions.

![](/files/-MCFpacEalGuWxKxeZ7H)

**Step 14:** Click on 'Create user group'

![](/files/-MCFqsOe-f2rFsTFVt5a)

**Step 15:** Click on 'User group' tab, enter 'Group name' as 'cfx\_notifications\_group'

![](/files/-MCFsFxWrqpBfMvxPZIJ)

**Step 16:** Click on 'Permissions' tab, and click on 'Select' to select all groups

![](/files/-MCFsfVKMWanp9You1qm)

**Step 17:** Select all 'Host Groups' as shown below and click 'Select'.

![](/files/-MCFtCBzXgB9dUB2XAm9)

**Step 18:** Select 'Read' permission, select 'Include subgroups' check-box and click on 'Add' button.

![](/files/-MCFu2_bAa45dn9EqKm0)

**Step 19:** On left menu, expand 'Administration' and click on 'Users' to add a new user with Read-only permissions.

![](/files/-MCFv3bl62EaoSjLBV5m)

**Step 20:** Click on 'Create user'.

![](/files/-MCFvJN-B9_fVnmPFyDt)

**Step 21:** Click on 'User' tab, enter Alias as 'cfx\_notification\_user'. Click on 'Select' to select the 'cfx\_notifications\_group' that was create above (Step 15). Enter user password.

![](/files/-MCFxfji4dEiSVrezH5Z)

**Step 22:** Click on 'Media' tab and click on 'Add' button as show in the below screen to add Webhook details.

![](/files/-MCFySG0P5086VzLReAR)

**Step 23:** Select 'CloudFabrix-Webhook' that was created in one of the step above (**Step 4**), and for 'Send to' field add the Webhook URL (**Step 17** of section '**Create Webhook for incoming alerts from Zabbix),** leave the rest of fields as showns in below screen and Click 'Add'

![](/files/-MCFzIQJciaLS2ADOure)

**Step 23:** Click 'Add' button to complete in adding the Webhook notification in Zabbix.

![](/files/-MCG-ZkcodhERhYoY7hb)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudfabrix.io/integrations/zabbix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
