DataDog / integrations-extras

Community developed integrations and plugins for the Datadog Agent.
BSD 3-Clause "New" or "Revised" License
252 stars 734 forks source link

Zabbix Agent not sending Zabbix alerts into datadog #1771

Open rahil471 opened 1 year ago

rahil471 commented 1 year ago

We are trying to send Zabbix Alerts into DD so that we can have them in one place.

We are using the below link for the integration.

https://docs.datadoghq.com/integrations/zabbix/

The integration shows successful OK and we are able to get Zabbix metrics, however we are not receiving Zabbix alerts as events into datadog.

We tried reaching the DD team and they directed us here. Here is their response, which might help.

Error log from DD flare. Error log from DD flare

Error observed on the media type integration page.

[datadog webhook] event creation failed : json undefined
[datadog webhook] event creation failed : ReferenceError : identifier 'CurlHttpRequest' undefined

Additionally they pointed out that the error is origination from this piece of code. Code

yzhan289 commented 1 year ago

Pinging @KosukeKamiya, the maintainer of the zabbix integration.

grady-reilly commented 9 months ago

@yzhan289 did you ever get a resolution to this? I am having the same issue setting up Event collection using the script recommended by both zabbix and datadog?

`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({});`