With this integration, get trigger alerts from Zabbix and have them converted to incidents within Freshservice so you can find quicker resolutions to critical issues.


Note: Customers should have an active account in Freshservice with AMS feature enabled.


How to install?

  1. From the Zabbix homepage, navigate to Configurations -> Actions -> Create Action.
  2. Under Actions, enter properties such as name and select the new condition as Trigger severity equals to high and click Add.
  3. Under Operations, check the default operations and click on New, enter the operation details.
  4. Click Add under Send to Users, choose Admin and Guest and click Select and click Add.
  5. Check the default subject and message under Recovery Operations and Update Operations and click Add to have the action added.


How to create a media type?

  1. From the Zabbix homepage, navigate to Administration -> Media Types -> Create Media Type.

  2. Under media type, enter the name, select the type as Webhook and add the parameters.

  3. Copy and paste the script and click Apply then check the “Include event menu entry” box and click Add.

  4. Once the media type is added, navigate to Admin -> Users -> Username (Admin) and under the media click Add.

  5. Add the details and then click Update to have the media updated for the particular user.


The auth-key (account_integrationkey) is unique to your respective Freshservice Accounts. You can obtain this key from your Account Details page in Freshservice.

 

Media Type - Javascript


try {

    Zabbix.Log(4, 'webhook script value='+value);

 

    var result = {

        'tags': {

            'endpoint': 'freshservice'

        }

    },

    params = JSON.parse(value),

    req = new CurlHttpRequest(),

    fields = {},

    resp;

 

    req.AddHeader('Content-Type: application/json');

    req.AddHeader('Authorization: auth-key <account_integrationkey>');

 

    resp = req.Post('https://subdomain.alerts.freshservice.com/alerts',

        JSON.stringify({ “updated_by”: “Zabbix”,

                                 "message": param.message,

                                 "description": param.description,

                                 "hostname": param.hostname,

                                 "ip_address": param.ipaddress,

                                 "resource": param.resource,

                                 "severity": param.severity,

                                 "value": param.value})

    );

 

    if (req.Severity() != 201) {

        throw 'Response code: '+req.Severity();

    }

 

    resp = JSON.parse(resp);

    result.tags.issue_id = resp.id;



} catch (error) {

    Zabbix.Log(4, 'jira issue creation failed json : '+JSON.stringify({"fields": fields}));

    Zabbix.Log(4, 'jira issue creation failed : '+error);

 

    result = {};

}