Connect to Zabbix to:
- Monitor Zabbix through the Datadog Agent.
- Send Zabbix alerts to Datadog to see the alerts as events in your Datadog event stream.
Follow the instructions below to install and configure this check for an Agent running on a host.
If you are using Agent v6.8+ follow the instructions below to install the Zabbix check on your host. See the dedicated Agent guide for installing community integrations to install checks with the Agent prior to version 6.8 or the Docker Agent:
-
Run the following command to install the integrations wheel with the Agent:
datadog-agent integration install -t datadog-zabbix==<INTEGRATION_VERSION>
-
Configure your integration like any other packaged integration.
-
Edit the
zabbix.d/conf.yaml
file, in theconf.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 for all available configuration options.
- Navigate to Administration > Media Types > Create Media Type.
- Add Datadog api_key as a parameter. And, add the following Zabbix template variables as parameters: {ALERT.MESSAGE}, {ALERT.SUBJECT}, {EVENT.DATE}, {EVENT.NAME}, {EVENT.NSEVERITY}, {EVENT.TAGSJSON}, {EVENT.TIME}, {EVENT.VALUE}, {ITEM.NAME}
- Set Name to
Datadog
, Type toWebhook
, and input the following code as the Script:
try {
Zabbix.Log(4, '[datadog webhook] received value=' + value);
var params = JSON.parse(value);
var req = new CurlHttpRequest();
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.Status() != 202) {
throw 'Response code: '+req.Status();
}
Zabbix.Log(4, '[datadog webhook] received response with status code ' + req.Status() + '\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.
- 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. - 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.
- Grant this user at least read permissions to all hosts for which it should send the alerts.
- Navigate to Configuration > Actions.
- From the page title dropdown, select the required action type.
- Click on Create Action.
- Name the action.
- Choose conditions upon which operations are carried out.
- Choose the operations to carry out.
Run the Agent's status subcommand and look for zabbix
under the Checks section.
See metadata.csv for a list of metrics provided by this check.
Zabbix alerts are collected as events in the Datadog event stream.
See service_checks.json for a list of service checks provided by this integration.
Need help? Contact Datadog support.