---
title: zabbix
description: Collect item history by the Zabbix API and report them to Datadog as metrics.
breadcrumbs: Docs > Integrations > zabbix
---

# zabbix
Supported OS Integration version1.1.1
{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="info" %}
To find out if this integration is available in your organization, see your [Datadog Integrations](https://app.datadoghq.com/integrations) page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [support@ddog-gov.com](mailto:support@ddog-gov.com).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Connect to Zabbix to:

- Monitor [Zabbix](https://www.zabbix.com/) through the Datadog Agent.
- Send Zabbix alerts to Datadog to see the alerts as events in your Datadog event stream.

## Setup{% #setup %}

The Zabbix check is not included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you need to install it.

### Installation{% #installation %}

For Agent v7.21+ / v6.21+, follow the instructions below to install the Zabbix check on your host. See [Use Community Integrations](https://docs.datadoghq.com/agent/guide/use-community-integrations.md) to install with the Docker Agent or earlier versions of the Agent.

1. Run the following command to install the Agent integration:

   ```shell
   datadog-agent integration install -t datadog-zabbix==<INTEGRATION_VERSION>
   ```

1. Configure your integration similar to core [integrations](https://docs.datadoghq.com/getting_started/integrations.md).

### Configuration{% #configuration %}

1. Make sure that your Zabbix server timezone is set to UTC. More information about Zabbix time zones can be found on the [Zabbix documentation](https://www.zabbix.com/documentation/current/en/manual/web_interface/time_zone).

1. Edit the `zabbix.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your Zabbix performance data. See the [sample zabbix.d/conf.yaml](https://github.com/DataDog/integrations-extras/blob/master/zabbix/datadog_checks/zabbix/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands.md#start-stop-and-restart-the-agent).

#### Event collection{% #event-collection %}

##### Create Datadog media type{% #create-datadog-media-type %}

1. Navigate to *Administration > Media Types > Create Media Type*.
1. Add parameters to the webhook using Zabbix template variables. Add your Datadog api_key and the following Zabbix template variables as parameters:

| Parameter         | Value                  |
| ----------------- | ---------------------- |
| `api_key`         | `Your Datadog API key` |
| `event_date`      | `{EVENT.DATE}`         |
| `event_name`      | `{EVENT.NAME}`         |
| `event_nseverity` | `{EVENT.NSEVERITY}`    |
| `event_tags`      | `{EVENT.TAGSJSON}`     |
| `event_time`      | `{EVENT.TIME}`         |
| `event_value`     | `{EVENT.VALUE}`        |
| `item_name`       | `{ITEM.NAME}`          |
| `alert_message`   | `{ALERT.MESSAGE}`      |
| `alert_subject`   | `{ALERT.SUBJECT}`      |
Set **Name** to `Datadog`, **Type** to `Webhook`, and input the following code as the **Script**:
```gdscript3
try {
	Zabbix.Log(4, '[datadog webhook] received value=' + value);

	var params = JSON.parse(value);
	var req = new HttpRequest();
	req.addHeader('Content-Type: application/json');
	var webhook_url = 'https://app.datadoghq.com/intake/webhook/zabbix?api_key=' + params.api_key;
	var webhook_data = value;
	var resp = req.post(webhook_url, webhook_data);
	if (req.getStatus() != 202) {
		throw 'Response code: '+req.getStatus();
	}
	Zabbix.Log(4, '[datadog webhook] received response with status code ' + req.getStatus() + '\n' + resp);
} catch (error) {
	Zabbix.Log(4, '[datadog webhook] event creation failed json : ' + webhook_data)
	Zabbix.Log(4, '[datadog webhook] event creation failed : ' + error);
}
return JSON.stringify({});
```
Validate the Webhook is set up correctly by using the "Test" button.
##### Assign Webhook media to an existing user{% #assign-webhook-media-to-an-existing-user %}

1. After configuring the Webhook media type, navigate to *Administration > Users* and create a dedicated Zabbix user to represent the Webhook. For example, use the alias `Datadog` for the Datadog Webhook. All settings, except media, can be left at their defaults as this user does not log in to Zabbix.
1. In the user profile, go to a **Media** tab and add a Webhook with the required contact information. If the Webhook does not use a send to field, enter any combination of supported characters to bypass validation requirements.
1. Grant this user at least read permissions to all hosts for which it should send the alerts.

##### Configure an alert action for the Webhook{% #configure-an-alert-action-for-the-webhook %}

1. Navigate to *Configuration > Actions*.
1. From the page title dropdown, select the required action type.
1. Click on **Create Action**.
1. Name the action.
1. Choose conditions upon which operations are carried out.
1. Choose the operations to carry out.

### Validation{% #validation %}

Run the [Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands.md#agent-status-and-information) and look for `zabbix` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **zabbix.processed.floats\_per\_sec**(gauge)                  | Number of processed numeric (float) values per second*Shown as unit*               |
| **zabbix.processed.per\_sec**(gauge)                          | Number of processed values per second*Shown as unit*                               |
| **zabbix.processed.characters\_per\_sec**(gauge)              | Number of processed character values per second*Shown as unit*                     |
| **zabbix.processed.logs\_per\_sec**(gauge)                    | Number of processed log values per second*Shown as unit*                           |
| **zabbix.processed.unsigned\_per\_sec**(gauge)                | Number of processed numeric (unsigned) values per second*Shown as unit*            |
| **zabbix.processed.text\_per\_sec**(gauge)                    | Number of processed text values per second*Shown as unit*                          |
| **zabbix.processed.unsupported\_per\_sec**(gauge)             | Number of processed not supported values per second*Shown as unit*                 |
| **zabbix.process.internal.alerter**(gauge)                    | Utilization of alerter internal processes, in %*Shown as percent*                  |
| **zabbix.process.internal.config\_sync**(gauge)               | Utilization of configuration syncer internal processes, in %*Shown as percent*     |
| **zabbix.process.internal.escalator**(gauge)                  | Utilization of escalator internal processes, in %*Shown as percent*                |
| **zabbix.process.internal.history\_sync**(gauge)              | Utilization of history syncer internal processes, in %*Shown as percent*           |
| **zabbix.process.internal.housekeeper**(gauge)                | Utilization of housekeeper internal processes, in %*Shown as percent*              |
| **zabbix.process.data\_collector.discoverer**(gauge)          | Utilization of discoverer data collector processes, in %*Shown as percent*         |
| **zabbix.process.data\_collector.http\_poller**(gauge)        | Utilization of http poller data collector processes, in %*Shown as percent*        |
| **zabbix.process.data\_collector.icmp\_pinger**(gauge)        | Utilization of icmp pinger data collector processes, in %*Shown as percent*        |
| **zabbix.process.data\_collector.ipmi\_poller**(gauge)        | Utilization of ipmi poller data collector processes, in %*Shown as percent*        |
| **zabbix.process.data\_collector.java\_poller**(gauge)        | Utilization of java poller data collector processes, in %*Shown as percent*        |
| **zabbix.process.data\_collector.poller**(gauge)              | Utilization of poller data collector processes, in %*Shown as percent*             |
| **zabbix.process.data\_collector.proxy\_poller**(gauge)       | Utilization of proxy poller data collector processes, in %*Shown as percent*       |
| **zabbix.process.internal.self\_monitoring**(gauge)           | Utilization of self-monitoring internal processes, in %*Shown as percent*          |
| **zabbix.process.data\_collector.snmp\_trapper**(gauge)       | Utilization of snmp trapper data collector processes, in %*Shown as percent*       |
| **zabbix.process.internal.timer**(gauge)                      | Utilization of timer internal processes, in %*Shown as percent*                    |
| **zabbix.process.data\_collector.trapper**(gauge)             | Utilization of trapper data collector processes, in %*Shown as percent*            |
| **zabbix.process.data\_collector.unreachable\_poller**(gauge) | Utilization of unreachable poller data collector processes, in %*Shown as percent* |
| **zabbix.queue.duration\_10**(gauge)                          | Zabbix queue over 10 minutes*Shown as unit*                                        |
| **zabbix.queue.size**(gauge)                                  | Zabbix queue*Shown as unit*                                                        |
| **zabbix.cache.config**(gauge)                                | Zabbix configuration cache, % used*Shown as percent*                               |
| **zabbix.cache.write**(gauge)                                 | Zabbix history write cache, % used*Shown as percent*                               |
| **zabbix.cache.index**(gauge)                                 | Zabbix history index cache, % used*Shown as percent*                               |
| **zabbix.cache.write\_trend**(gauge)                          | Zabbix trend write cache, % used*Shown as percent*                                 |
| **zabbix.agent.ping**(gauge)                                  | Zabbix agent ping*Shown as unit*                                                   |
| **zabbix.process.data\_collector.vmware**(gauge)              | Utilization of vmware data collector processes, in %*Shown as percent*             |
| **zabbix.cache.value**(gauge)                                 | Zabbix value cache, % used*Shown as percent*                                       |
| **zabbix.cache.value.hits**(gauge)                            | Zabbix value cache hits*Shown as hit*                                              |
| **zabbix.cache.value.misses**(gauge)                          | Zabbix value cache misses*Shown as miss*                                           |
| **zabbix.cache.vmware**(gauge)                                | Zabbix vmware cache, % used*Shown as percent*                                      |
| **zabbix.cache.operating\_mode**(gauge)                       | Zabbix value cache operating mode*Shown as unit*                                   |
| **zabbix.process.internal.task\_manager**(gauge)              | Utilization of task manager internal processes, in %*Shown as percent*             |
| **zabbix.process.internal.ipmi\_manager**(gauge)              | Utilization of ipmi manager internal processes, in %*Shown as percent*             |
| **zabbix.process.internal.alert\_manager**(gauge)             | Utilization of alert manager internal processes, in %*Shown as percent*            |
| **zabbix.process.internal.preprocessing\_manager**(gauge)     | Utilization of preprocessing manager internal processes, in %*Shown as percent*    |
| **zabbix.process.internal.preprocessing\_worker**(gauge)      | Utilization of preprocessing worker internal processes, in %*Shown as percent*     |
| **zabbix.queue.preprocessing**(gauge)                         | Zabbix preprocessing queue*Shown as unit*                                          |
| **zabbix.queue.lld**(gauge)                                   | Zabbix LLD queue*Shown as unit*                                                    |
| **zabbix.process.internal.lld\_manager**(gauge)               | Utilization of LLD manager internal processes, in %*Shown as unit*                 |
| **zabbix.process.internal.lld\_worker**(gauge)                | Utilization of LLD worker internal processes, in %*Shown as percent*               |
| **zabbix.cpu.count**(gauge)                                   | Number of CPUs*Shown as unit*                                                      |
| **zabbix.cpu.iowait\_time**(gauge)                            | CPU iowait time                                                                    |
| **zabbix.context\_switches\_per\_sec**(gauge)                 | Context switches per second                                                        |
| **zabbix.cpu.guest\_nice\_time**(gauge)                       | CPU guest nice time                                                                |
| **zabbix.cpu.guest\_time**(gauge)                             | CPU guest time                                                                     |
| **zabbix.cpu.softirq\_time**(gauge)                           | CPU softirq time                                                                   |
| **zabbix.cpu.interrupt\_time**(gauge)                         | CPU interrupt time                                                                 |
| **zabbix.cpu.steal\_time**(gauge)                             | CPU steal time                                                                     |
| **zabbix.cpu.nice\_time**(gauge)                              | CPU nice time                                                                      |
| **zabbix.load.avg.1\_min**(gauge)                             | Load average (1m avg)                                                              |
| **zabbix.cpu.user\_time**(gauge)                              | CPU user time                                                                      |
| **zabbix.cpu.system\_time**(gauge)                            | CPU system time                                                                    |
| **zabbix.cpu.idle\_time**(gauge)                              | CPU idle time                                                                      |
| **zabbix.load.avg.15\_min**(gauge)                            | Load average (15m avg)                                                             |
| **zabbix.load.avg.5\_min**(gauge)                             | Load average (5m avg)                                                              |
| **zabbix.interrupts\_per\_sec**(gauge)                        | Interrupts per second                                                              |
| **zabbix.memory.avail\_percent**(gauge)                       | Available memory in %                                                              |
| **zabbix.memory.total**(gauge)                                | Total memory                                                                       |
| **zabbix.memory.avail**(gauge)                                | Available memory                                                                   |
| **zabbix.swap\_space.total**(gauge)                           | Total swap space                                                                   |
| **zabbix.swap\_space.free**(gauge)                            | Free swap space                                                                    |
| **zabbix.swap\_space.free\_percent**(gauge)                   | Free swap space in %                                                               |
| **zabbix.system.uptime**(gauge)                               | System uptime                                                                      |
| **zabbix.system.boot\_time**(gauge)                           | System boot time                                                                   |
| **zabbix.system.local\_time**(gauge)                          | System local time                                                                  |
| **zabbix.user.logged\_in**(gauge)                             | Number of logged in users                                                          |
| **zabbix.open\_fd.max**(gauge)                                | Maximum number of open file descriptors                                            |
| **zabbix.processes\_max**(gauge)                              | Maximum number of processes                                                        |
| **zabbix.processes\_count**(gauge)                            | Number of processes                                                                |
| **zabbix.processes\_running\_count**(gauge)                   | Number of running processes                                                        |
| **zabbix.cpu.used**(gauge)                                    | CPU utilization                                                                    |
| **zabbix.agent.avail**(gauge)                                 | Zabbix agent availability                                                          |
| **zabbix.process.internal.alert\_sync**(gauge)                | Utilization of alert syncer internal processes, in %*Shown as percent*             |
| **zabbix.memory.used**(gauge)                                 | Memory utilization                                                                 |

### Events{% #events %}

Zabbix alerts are collected as events in the Datadog event stream.

### Service Checks{% #service-checks %}

**zabbix.can\_connect**

Returns `CRITICAL` if the Agent can't connect to the Zabbix API, OK otherwise

*Statuses: ok, critical*

## Trigger on-call pages{% #trigger-on-call-pages %}

Configure a Zabbix Webhook media type to forward triggers to the Datadog events intake, which routes them to [Datadog On-Call](https://docs.datadoghq.com/service_management/on-call.md) using an `oncall_team` query parameter. Datadog deduplicates and auto-resolves events that share an `aggregation_key`, so a Zabbix `OK` resolves the page created by the corresponding `PROBLEM` automatically.

### Map Zabbix triggers to on-call pages{% #map-zabbix-triggers-to-on-call-pages %}

| Zabbix `{EVENT.VALUE}` | `{EVENT.NSEVERITY}`                 | Event `category` | Alert `status` | On-Call effect                                    |
| ---------------------- | ----------------------------------- | ---------------- | -------------- | ------------------------------------------------- |
| `1` (PROBLEM)          | `5` Disaster                        | `alert`          | `error`        | Pages the configured On-Call team                 |
| `1` (PROBLEM)          | `4` High                            | `alert`          | `error`        | Pages the configured On-Call team                 |
| `1` (PROBLEM)          | `3` Average                         | `alert`          | `warn`         | Pages the configured On-Call team                 |
| `1` (PROBLEM)          | `2` Warning                         | `alert`          | `warn`         | Pages the configured On-Call team                 |
| `1` (PROBLEM)          | `0`-`1` Not classified, Information | `alert`          | `warn`         | Pages the configured On-Call team                 |
| `0` (OK)               | n/a                                 | `alert`          | `ok`           | Resolves the page with the same `aggregation_key` |

### Setup{% #setup-1 %}

#### Create the on-call media type{% #create-the-on-call-media-type %}

1. Navigate to **Administration > Media Types > Create Media Type**.
1. Set **Name** to `Datadog On-Call` and **Type** to `Webhook`.
1. Add the following parameters:

| Parameter         | Value                       |
| ----------------- | --------------------------- |
| `dd_api_key`      | `<YOUR_DATADOG_API_KEY>`    |
| `dd_site`         | `datadoghq.com`             |
| `oncall_team`     | `<YOUR_ONCALL_TEAM_HANDLE>` |
| `event_value`     | `{EVENT.VALUE}`             |
| `event_nseverity` | `{EVENT.NSEVERITY}`         |
| `event_name`      | `{EVENT.NAME}`              |
| `host_name`       | `{HOST.NAME}`               |
| `trigger_id`      | `{TRIGGER.ID}`              |
| `alert_message`   | `{ALERT.MESSAGE}`           |

Set `dd_site` to your Datadog site, for example, `datadoghq.eu` or `us3.datadoghq.com`. Set `oncall_team` to the team handle configured in [Datadog On-Call](https://docs.datadoghq.com/service_management/on-call.md), without the `@oncall-` prefix.
Input the following code as the **Script**:
```javascript
try {
    var params = JSON.parse(value);
    var problem = params.event_value === '1';
    var nseverity = parseInt(params.event_nseverity, 10);

    var status = 'warn';
    if (!problem) {
        status = 'ok';
    } else if (nseverity >= 4) {
        status = 'error';
    }

    var payload = {
        data: {
            type: 'event',
            attributes: {
                category: 'alert',
                title: 'Zabbix: ' + params.host_name + ' - ' + params.event_name,
                message: params.alert_message,
                integration_id: 'zabbix',
                aggregation_key: 'zabbix:' + params.host_name + ':' + params.trigger_id,
                tags: ['integration:zabbix', 'host:' + params.host_name],
                attributes: { status: status },
                zabbix: { source: 'zabbix-server' }
            }
        }
    };

    var url = 'https://event-management-intake.' + params.dd_site +
              '/api/v2/events/webhook?dd-api-key=' + encodeURIComponent(params.dd_api_key) +
              '&integration_id=zabbix&oncall_team=' + encodeURIComponent(params.oncall_team);

    var req = new HttpRequest();
    req.addHeader('Content-Type: application/json');
    var resp = req.post(url, JSON.stringify(payload));

    if (req.getStatus() < 200 || req.getStatus() >= 300) {
        throw 'Datadog On-Call notification failed: HTTP ' + req.getStatus() + ' ' + resp;
    }
} catch (error) {
    Zabbix.Log(4, '[datadog oncall] ' + error);
    throw error;
}
return JSON.stringify({});
```
Validate the webhook is set up correctly by using the **Test** button.
#### Assign the media to a user{% #assign-the-media-to-a-user %}

Follow the same steps as in *Assign Webhook media to an existing user* above. The dedicated `Datadog` user can host both media types.

#### Configure an alert action{% #configure-an-alert-action %}

Create a Zabbix action targeting the `Datadog On-Call` media type. Make sure the action is enabled both on the **PROBLEM** (firing) and on the **Recovery** event so that resolutions reach Datadog and the corresponding On-Call page auto-resolves.

Verify pages appear under **On-Call > Pages** in Datadog.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
