# PagerDuty

## Introduction&#x20;

[PagerDuty](https://www.pagerduty.com/) is a leader in IT Incident Response, offering cloud based solution for incident management and on-call routing. This section explains on how to integrate CloudFabrix AIOps with PagerDuty.&#x20;

This integration offers bi-directional integration between CloudFabrix AIOps and PagerDuty.&#x20;

**Integration Highlights:**&#x20;

* Creates Incidents in PagerDuty for every Actionable Incident created in CFX AIOps
* Updates performed in PagerDuty by On-Call team are reflected back in CFX AIOps&#x20;
  * (Ex: priority/urgency changes, ticket assignment, notes updates etc.)
* Similarly, Incident updates done in CFX AIOps are reflected in PagerDuty
* From CFX AIOps, diagnostic results and comments can be shared to PagerDuty Incident&#x20;
* Once Incident is resolved by PagerDuty on-call team, the incident on CFX platform will  also be marked as resolved.

## Prerequisites

## Enabling API access on PagerDuty&#x20;

#### Step1: Get Event API Token

1.Login to PagerDuty as the Administrator / Account owner. Navigate to Integrations under Configuration-> Service-> Integrations.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJC0Z4_ZOrvXakh8Brp%2F-MJC2njML6jX_Ew6NRCO%2Fimage.png?alt=media\&token=ff8479d1-ded2-4ccb-afbc-7617d9a1e20b)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJC0Z4_ZOrvXakh8Brp%2F-MJC2QgJEISUsiZvEu_F%2Fimage.png?alt=media\&token=a6258935-4653-4e34-818b-dcc080fee74b)

2\. Rest API Key

To retrieve API key, login as PagerDuty administrator / Account owner. Navigate to Configuration->API Access.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6NSdJvwNdUo6A4R-A%2F-MK6NYQMu0GD58Ipi8mX%2Fimage.png?alt=media\&token=f2c4485c-a229-4d46-875c-51a8362587e6)

3\. Enter Description and click on 'Create Key.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Ncy30kd5JfrhkQ39%2F-MK6NoL_3GvSj5efN26c%2Fimage.png?alt=media\&token=3b377828-7e60-414c-9700-929989342f3f)

#### Step 2: Setting up the Service

1.Login as PagerDuty Administrator / Account owner. Navigate to Configuration and Services.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6OFpWHHxRmTr7LG1j%2Fimage.png?alt=media\&token=aab772e4-f9ed-433d-af16-2dbf20e0ef31)

#### Step 3: Set up Escalation policy

1.Login as PagerDuty Administrator / Account Owner. Navigate to Configuration and Escalation Policies.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6OTjONajE48iFMMjU%2Fimage.png?alt=media\&token=cd3b5c41-e7ed-4327-8627-056ddf9be1b3)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6Oh2CUFUsllhbcWIu%2Fimage.png?alt=media\&token=3063afd0-9db9-4621-bde6-245e3207eca1)

#### Step 4: Add Team Members

1.Login as PagerDuty Administrator / Account Owner. Navigate to Configuration and Teams.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6PBIvC_GipL8hZEvw%2Fimage.png?alt=media\&token=3eb0237e-a7c4-4037-b967-63e793638adf)

2\. Add User(s)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6PMbWJYGNSDHLQfhi%2Fimage.png?alt=media\&token=85ad2435-2023-4df0-8baa-ee047dc7fec1)

#### Step 5: Setup Webhook

1.Login as PagerDuty Administrator / Account owner and navigate to Configuration-> Services-> Integrations.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6P_igc4QSwek7kwlg%2Fimage.png?alt=media\&token=72b324ca-07c2-4a23-8d0b-c6d753e25b19)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6Nrh1cIaCTNtNJeB-%2F-MK6PwJYxRpSTzOUR8qn%2Fimage.png?alt=media\&token=8db31c8f-ba3c-4268-9250-7a04fe1e0aa7)

## Adding PagerDuty as DataSource

**Step 1**: Login to cfxDimensions through web browser UI and login to cfxOIA application. Select the project and on context menu 'Configure Project'

**Step 2**: Select 'DataSources' from left navigation tabs and click on '+' to add new data source as shown below.

![Click on '+' to add new data source](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV4_KkbFuM8Huot7aZ%2F-MJV5gkWZlEJfXS6POKG%2Fimage.png?alt=media\&token=cc165054-448c-4afc-83f8-c42501fc2141)

**Step 3**: New DataSource Add screen is displayed. Enter Datasource Name, Datasource Description, If Gateway access is required and select DataSource Type 'PagerDuty' from the displayed datasources as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV4_KkbFuM8Huot7aZ%2F-MJV6E9r7BKmStYlMAK_%2Fimage.png?alt=media\&token=820df976-fa28-4358-a2c6-4cddeebd5360)

**Step 4**: The view expands to capture information related to PagerDuty as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV4_KkbFuM8Huot7aZ%2F-MJV6oBYnRg1ny0bsKLZ%2Fimage.png?alt=media\&token=c070f58f-5b54-4e90-8a28-2275c3d01944)

**Step 5**: Fill in the details and click on '***Test Connectivity***' to ensure the entered details are correct. Click on 'Save'.

A sample PagerDuty details are as shown below.

![Sample PagerDuty Details](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV4_KkbFuM8Huot7aZ%2F-MJV7mh2F3Lal8vt59Ti%2Fimage.png?alt=media\&token=56c4a0b8-331d-4061-87df-76de157113cd)

## Adding Team(s) to PagerDuty

**Step 1**: Login to cfxDimensions and select cfxOIA application. Select Project -> Configure Project. Select '**Teams**' on left side tab menu and click on **'+**' as shown below.

![Click on '+' to crate new team](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV8t1A3tkwdUv4eneK%2F-MJV9BbUTWo-epUXhIpd%2Fimage.png?alt=media\&token=43443907-89f1-4f8b-bfc3-d7e2e1700b2d)

**Step 2:** The following view is displayed. Select Team Name 'PagerDuty'

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJV8t1A3tkwdUv4eneK%2F-MJV9X0Q-Xh465NQfSfc%2Fimage.png?alt=media\&token=f03277f8-c771-41a2-802a-17d428cf1135)

**Step 3**: The following view is displayed. Enter Team Name, Description and select PagerDuty.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVLjSCK8SeN-k526lr%2F-MJVqZXi5CVvwKl6Ogom%2Fimage.png?alt=media\&token=3b81d930-70cf-4292-bf3d-c4cf4995b6e8)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVr7zO-K9maQKvMDmn%2F-MJVt1BIINMtD0HOe-It%2Fimage.png?alt=media\&token=fc1caf84-549b-47db-ab2c-12a3024240f2)

{% hint style="info" %}
Enabling Auto Share allows to automatically send updates to PagerDuty whenever there is an update in cfxOIA incident.
{% endhint %}

Click **Finish.**

## EndPoints Configuration (PagerDuty to cfxOIA)

**Step 1**: Webhook is commonly used endpoint. The webhook URL generated in cfxOIA is used to configure the webhook on PagerDuty.

**Step 2**: Login into cfxDimensions and select cfxOIA app. Open the project in edit configuration mode. Select 'Incidents' on left menu, on Incident Endpoints, click on '**+**' as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVwY-U4o6wftHDSXLC%2F-MJVwg6YCGTVmmvBTOXW%2Fimage.png?alt=media\&token=a7be7358-b134-4347-8471-eb8382534109)

**Step 3**: Select Endpoint role as '**Source**' or '**Target**', select Event Type (ex: OIA Incident).

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVwY-U4o6wftHDSXLC%2F-MJVxOwZmtfff83sgKTp%2Fimage.png?alt=media\&token=70a329a4-e289-4c61-81c2-02cc996e5135)

**Step 4:** Select 'EndPoint Type' as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVxaUX_Ge3-nbXM0JC%2F-MJVxuQqfJELdMahGSxR%2Fimage.png?alt=media\&token=4e798c6a-58a6-4797-8a1c-34e9c5b6cd21)

Depending on the endpoint type selected, the view changes to capture corresponding information as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJVxaUX_Ge3-nbXM0JC%2F-MJVyVUoRtSg2NABfbO6%2Fimage.png?alt=media\&token=9e2d3da5-0a7d-404a-b307-3d30ba180fe4)

**Step 5**: Click Save. &#x20;

**Step 6**: From initial 'Incidents End Point view', you can access webhooks on the context menu of each end point as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJW-4bglKP4LkDarKdO%2F-MJW-Sn94BkwchMymrsV%2Fimage.png?alt=media\&token=0ce42500-1942-417a-b81b-80b2b6aea2ea)

**Step 7**: The following image shows sample Endpoints for CloudFabrix to PagerDuty (Target) .

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6QGE5daLnz8q013vP%2F-MK6RS4pTThX9y6rBups%2Fimage.png?alt=media\&token=9c40f394-1b03-447d-b17b-045b9641186b)

**Step 8**: The following shows sample endpoint from PagerDuty to CloudFabrix OIA (Source)

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6QGE5daLnz8q013vP%2F-MK6RfX_ldezp7a-filt%2Fimage.png?alt=media\&token=f8bba5f5-dd41-4f32-9f74-c4ce98e80e8f)

**Step 9**: Create Mappings between Source and Target Endpoints. click on '**+**' on 'Incident Mappings' tab as shown below.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJW-lt3i4im8zxkfYmw%2F-MJW2rrhPT37tY0jDhrd%2Fimage.png?alt=media\&token=543facba-db2f-4dc9-95c4-8124e7671a89)

**Step 10**: The following mapping view is displayed.  The information is captured in stepped views as shown from Selecting endpoints, mapper, pipeline, script before confirmation.&#x20;

In first step select source and target endpoints, click Next.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MK6QGE5daLnz8q013vP%2F-MK6RsTbJxT82X9rKciQ%2Fimage.png?alt=media\&token=f070b164-7109-4aa9-bc08-eca30b515863)

**Step 11**: Select Mapper and Click Next

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJW-lt3i4im8zxkfYmw%2F-MJWDVi7G-GgGGbCD8CG%2Fimage.png?alt=media\&token=c94cfd4a-e3ba-4b5a-943a-1a20e87e4641)

**Step 12**:  Select Pipeline and click Next

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJWDcI-LIl0HW4ExTdf%2F-MJWDkifPzsr0mmVBve9%2Fimage.png?alt=media\&token=03d00666-8909-4c6a-be57-12d4c6e3545e)

**Step 13**: Update scrips either in JSON or Python format and click Test the script before clicking Next

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJWDcI-LIl0HW4ExTdf%2F-MJWE9gjFAepb1V32y4P%2Fimage.png?alt=media\&token=8c3c1c2b-315d-41d5-a8a7-addf81dd6e9b)

Step 14: Confirm the entries on the 'Confirm' step and click '**Finish**' as shown.

{% hint style="info" %}
CloudFabrix's default script provides basic handling. However, users can modify the script to provide custom handler by updating the script here. Ensure to test the script after modification.
{% endhint %}

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJWECEv85ye4nTpBWmR%2F-MJWEPvvF452O3MfEwcM%2Fimage.png?alt=media\&token=5695ebcc-441f-4d32-8800-edc686d915bc)

**Step 15**:  Once mappings are completed, the Incidents Mappings are displayed. The newly created mapping needs to be 'Enabled' by clicking 'Enable' on context menu of the mapping. The Enable/Disable gets toggled to activate or deactivate the mapping.

![](https://4260296531-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAygHzNCQ33zRR43qxF%2F-MJWEU5Kuh6fq5thRB9c%2F-MJWF0Nn_PH9uq0ZRfsh%2Fimage.png?alt=media\&token=698eadd3-3eab-44fb-9199-15a36dab7b8c)

## Contacting Support

Support queries related to this integration can be sent to <support@cloudfabrix.com>
