Skip to main content
All CollectionsIntegrations
Data Push Destinations Example Using the Generic HTTP Endpoint with PagerDuty
Data Push Destinations Example Using the Generic HTTP Endpoint with PagerDuty
Updated over 2 years ago

PagerDuty is one of the industry leading tools for responding to critical incidents. Although we do not have a dedicated PagerDuty integration, this example will show how you can send issue data from your UXI dashboard to PagerDuty using the Generic HTTP Endpoint Data Push Destination using the PagerDuty Custom Event Transformer.

Before you begin, please be aware the issue data from UXI is sent as soon as it’s available. This can result in lots of incidents created in PagerDuty. You might consider managing the alerts by only generating events for specific issue codes of interest in your Custom Event Transformer script, creating a dummy user and setting your escalation policy to first alert the dummy user, using content-based alert grouping and using event rules or event orchestration.

To get started, create a new service in PagerDuty for Aruba UXI. You can edit the noise reduction and assign an escalation policy when you create the service or update it later. Under Integrations, make sure you select Custom Event Transformer.

Once you created the service, select it then view the Integrations tab. Update the Custom Event Transformer javascript code to process the issues sent via the UXI HTTP Generic Data Push. Below is an example that creates and resolves events using the issue uid. You may consider enhancing this to only look for specific issue codes.

var issues = PD.inputRequest.body;
var events = [];
for (let item = 0; item < issues.length; item++) {
var issue_uid = issues[item].uid;
var code = issues[item].code;
var details = issues[item];
var sensor_name = issues[item].context.sensor_name;
var network_name = issues[item].context.network_name;
var service_name = issues[item].context.service_name;
var description = sensor_name + ':' + network_name + ':' + service_name + ':' + code;
if (service_name == null) {
description = sensor_name + ':' + network_name + ':' + code
}

var event_type = PD.Trigger;

var normalized_event = {
event_type: event_type,
incident_key: issue_uid,
description: description,
details: details
};

events.push(normalized_event);
//PD.emitGenericEvents([normalized_event]);

if (issues[item].status == "RESOLVED") {
event_type = PD.Resolve;
var normalized_event = {
event_type: event_type,
incident_key: issue_uid,
description: description,
details: details
};
events.push(normalized_event);
}
}
PD.emitGenericEvents(events);

Copy down the Integration URL for the Custom Event Transformer.

Next, open the UXI dashboard and navigate to Setting -> Integrations.

Under Data Push Destinations, Select Add Destination.

Enter the following in the menu.

  • Data Type: Issues (Do not send test results)

  • Destination Type: Generic HTTP Endpoint

  • Name: Give the data push a unique friendly name

  • URL: enter the URL for the Custom Event Transformer.

  • Username: You can type anything here. Do not leave blank

  • Password: You can type anything here. Do not leave blank

Select Submit.

Note that although the data push generic HTTP endpoint uses HTTP Basic Auth, PagerDuty has authentication as part of the URL. Based on our testing, you can simply use the URL and enter anything in the username and password field.

After a few minutes, you should begin seeing incidents in PagerDuty.

From here you may want to adjust your escalation policy to first alert a dummy user and only escalate if the issue has been ongoing for a long time.

To further reduce the noise, you might also consider setting notifications based on support hours, using Content-Based Alert Grouping, using Event Service Rules and Event Orchestration.

Did this answer your question?