> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/inbound-integrations/zabbix/script.md).

# Zabbix 2.2 – 4.3 Integration

The ilert Zabbix Integration helps you to easily connect ilert with Zabbix.

## System Requirements <a href="#requirements" id="requirements"></a>

{% hint style="info" %}
Are you using Zabbix 4.4 or higher? Please refer our [Zabbix 4.4+ Integration](/integrations/inbound-integrations/zabbix/native.md) guide.
{% endhint %}

* Zabbix 2.2 - 3.x
* Python 3.x

## In ilert: Create a Zabbix alert source <a href="#create-alarm-source" id="create-alarm-source"></a>

1. Go to **Alerting** → **Alert sources** and click **Create new alert source**.
2. Search for **Zabbix**, click its tile, and click **Next**.
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Choose who gets notified: select **Use existing escalation policy** and pick a policy, or **Generate new escalation policy** to start with a basic one that notifies you first. Click **Next**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-8a281bf3931f5a1a531951ce97984d50989dd875%2Falert-source-escalation-step.png?alt=media" alt="The escalation step of the ilert alert source wizard, headed Who should be notified about alerts, with an escalation policy selected and a preview of its escalation rules below."><figcaption><p>Pick an existing escalation policy, or generate a basic one without leaving the wizard.</p></figcaption></figure>
5. Select **Default grouping** and click **Next**. The wizard then asks **Enable two-way alert status sync?** Decide whether status changes should also flow back to Zabbix, and click **Continue setup**.
6. The next page shows more settings, such as notification priority and alert templates. Click **Finish setup** for now, or **Continue setup** if you turned two-way sync on.
7. On the final page, ilert shows the integration key and URL for this alert source. You will need them later in this guide.

## In Zabbix: Download the Zabbix plugin <a href="#zabbix" id="zabbix"></a>

1. Download the ilert Zabbix plugin script. The script must be executable by both Zabbix and the cron daemon:

```
> wget https://raw.githubusercontent.com/iLert/ilert-zabbix/master/ilert-zabbix.py 
> chmod 755 ilert-zabbix.py
```

1. Move the plugin into the `AlertsScriptsPath` directory. Typically, this is the `/usr/local/share/zabbix/alertscripts` or `/usr/lib/zabbix/alertscripts`.

When in doubt, check the file `zabbix_server.conf`.

```
> mv ilert-zabbix.py /usr/lib/zabbix/alertscripts/
```

### Create ilert media type

1. Go to the **Administration → Media types** tab and click the **Create media type** button.

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_OvcAdz-TSZ5Nr19v%2Fzb2.png?alt=media\&token=1d8f4bee-c368-4ca4-b267-d078fc358d0d)

1. On the **media type** configuration page, enter "iLert" as name, select "Script" as **type** and `ilert-zabbix.py` as **script name** .

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_OyaiY_xZCINS4Jvi%2Fzb3.png?alt=media\&token=9386f005-1d72-46a1-91a6-c838df17e84b)

1. Add three **script parameters** by clicking on **Add** three times and enter the following macros in the specified order.

**Note:** This step is not necessary in Zabbix 2.2 , because in this version these three script parameters are passed by default.

* `{ALERT.SENDTO }`
* `{ALERT.SUBJECT }`
* `{ALERT.MESSAGE }`

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_P3-tYR1ZVgWWlF-I%2Fzb4.png?alt=media\&token=640e694d-438c-405d-a89f-7d0d704d404a)

1. Click the **Add** button to save the media type.

### Create ilert user and group

1. Go to the **Administration → User groups** tab and click the **Create user group** button.

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_P6N_qxMt81zmvZBJ%2Fzb5.png?alt=media\&token=5c6946c6-d676-4096-8836-fa4ab8620ac7)

1. Set the name for the ilert group (eg "ilert group").

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_P9JvvJgA8CfeS4Hx%2Fzb6.png?alt=media\&token=a21d5547-8523-43a3-8f0a-8a1c6a172cf4)

1. Switch to the **Permissions** tab and select the **host groups** that the ilert group should have read access to send notifications. Without read access, ilert cannot receive notifications for the hosts in the group (see also [here](https://www.zabbix.com/documentation/3.4/manual/quickstart/notification)).
2. Click the Add button to save the group.

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PEiyuUCAdfieRJJO%2Fzb7.png?alt=media\&token=369531b7-664c-4c01-a4a4-45871b579f92)

1. Switch to the Users tab and click the **Create user** button.

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PHY_7pxZfMrfreKu%2Fzb8.png?alt=media\&token=df1b889a-a1bf-4449-b148-30dc7d258e30)

1. Assign **alias** and **name** and add the user to the ilert group. No further details such as password are necessary as this user will not log in to Zabbix.

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PMYyddY1LQJHuZf0%2Fzb9.png?alt=media\&token=719137a2-06d4-46c9-a708-25143f1860f9)

1. Switch to the **Media** tab and click the **Add** link

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PPPgLS8HMHXFGZGD%2Fzb10.png?alt=media\&token=5392a0f5-aa7c-478a-a967-7d44f0645de3)

1. In the **media** window, select ilert as **Type** , enter the API key generated above in the **Send to** field and click the **Add** button

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PSs6UBxmHPhExbSH%2Fzb11.png?alt=media\&token=90eb2e5a-e455-4aa4-b6a8-f7f5167b6710)

1. Click the **Add** button in the **Users** tab to save the user.

### Create an alert action

1. Switch to the **Configuration → Actions** tab and click the **Create action** button

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PaIQVp-YPehWEews%2Fzb12.png?alt=media\&token=54370e67-a23e-4872-9469-df3b248dc55b)

1. Give the action a name, eg "ilert notifications".

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PdZsFtVJIrzWz6_Y%2Fzb13.png?alt=media\&token=fe905e25-15d5-4b6b-a017-92e706681267)

1. Perform the following actions on the **Operations**, **Recovery operations** and **Acknowledgment operations** tabs
2. Fill in the default subject and default message exactly as shown below.
3. Click on the New link under Operations and select the ilert group created above under Send to User groups . Then click on the Add link.

**Operations**

* **Default subject** `alert`
* **Default message**

  ```
  {
   "EVENT.ID": "{EVENT.ID}",
   "TRIGGER.ID": "{TRIGGER.ID}",
   "TRIGGER.VALUE": "{TRIGGER.VALUE}",
   "TRIGGER.NAME": "{TRIGGER.NAME}",
   "TRIGGER.DESCRIPTION": "{TRIGGER.DESCRIPTION}",
   "TRIGGER.STATUS": "{TRIGGER.STATUS}",
   "TRIGGER.SEVERITY": "{TRIGGER.SEVERITY}",
   "TRIGGER.URL": "{TRIGGER.URL}",
   "HOST.HOST": "{HOST.HOST}",
   "HOST.IP": "{HOST.IP}"
  }
  ```

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_Ppss4DjNNJDE4GTl%2Fzb14.png?alt=media\&token=3d8b9cc9-1c7a-4684-8838-b3c3f1fad4b2)

#### Recovery operations

* **Default subject** `resolve`
* **Default message**

  ```
  {
   "EVENT.ID": "{EVENT.ID}"
  }
  ```

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_PvqXNsv3WRAKHc2T%2Fzb15.png?alt=media\&token=c94fb2a5-cb09-4345-be08-06cedd220e6a)

#### Acknowledgment operations

* **Default subject** `ack`
* **Default message**

  ```
  {
   "EVENT.ID": "{EVENT.ID}"
  }
  ```

![](https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M76ygPnS4HUcFSX8ulm%2F-M9_O9Xw-wdJQH_If0zs%2F-M9_Q5M1w7CfRdtTJUFE%2Fzb16.png?alt=media\&token=6d63b5ea-ab4d-493b-a065-4a35ef5665ae)

1. Click the **Add** button to save the action

### Set up cron job

In the event that the events generated by Zabbix cannot be sent to ilert on the first attempt (e.g. due to a network problem), a cron job is set up. This cron job is executed every minute and sends all failed events to ilert.

1. Edit the crab file from the Zabbix user

```
> sudo crontab -u zabbix -e
```

1. Add the following entry

```
* * * * * /usr/lib/zabbix/alertscripts/ilert-zabbix.py -m send
```

Adjust the directory according to your `AlertScriptsPath` configuration in Zabbix.

1. The Zabbix integration is now set up!

## FAQ <a href="#faq" id="faq"></a>

**Are alerts automatically resolved in ilert?**

Yes, as soon as the status of an alert is OK in Zabbix, the associated alert is resolved in ilert.

**Can I link Zabbix to multiple alert sources in ilert?**

Yes, create several **ilert users** in Zabbix and store the corresponding **API key** in the user **Send To** field.

**What if my internet connection is lost? Are the events generated in Zabbix lost?**

No events are lost. The plugin saves the events locally in a temporary directory and tries to send them to ilert every minute. As soon as your connection is available again, buffered events are sent to ilert. We also recommend that you monitor your Internet connection with an external monitoring service. You can then send these alerts to ilert.

**The plugin does not work. How do I find the mistake?**

Please look first in the log file. The plugin uses the Unix / Linux system log for logging (eg under `/var/log/messages` or `/var/log/syslog` ). If you can not find the error, please contact our support at <support@ilert.com>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ilert.com/integrations/inbound-integrations/zabbix/script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
