PagerDuty - Alerting Extension

 This extension works only with a dedicated SaaS controller or an on-prem controller. 

 

PagerDuty provides SaaS IT on-call schedule management, alerting and incident tracking. AppDynamics integrates directly with PagerDuty to create incidents in response to alerts. With the PagerDuty integration you can leverage your existing alerting infrastructure to notify the operations team to resolve performance degradation.

 

Prerequisites

 

You should have a PagerDuty Service Key

 

Installation

 

Please use the pagerduty-alert_1.0.3.zip for controller version 3.x and pagerduty-alert_2.2.zip for controller version 4.x.  

 

  1. Download the PagerDuty Alerting Extension zip from [AppDynamics Exchange](http://community.appdynamics.com/t5/AppDynamics-eXchange/idb-p/extensions) 
  2. Unzip the pagerduty-alert.zip file into <CONTROLLER_HOME_DIR>/custom/actions/ . You should have <CONTROLLER_HOME_DIR>/custom/actions/pagerduty-alert created. 
  3. Check if you have custom.xml file in <CONTROLLER_HOME_DIR>/custom/actions/ directory. If yes, add the following xml to the <custom-actions> element.
<action>
     <type>pagerduty-alert</type>
     <!-- For Linux/Unix *.sh -->
     <executable>pagerduty-alert.sh</executable>
     <!-- For windows *.bat -->
     <!--<executable>pagerduty-alert.bat</executable>-->
</action>

 If you don't have custom.xml already, create one with the below xml content

<custom-actions>
     <action>
     	  <type>pagerduty-alert</type>
          <!-- For Linux/Unix *.sh -->
     	  <executable>pagerduty-alert.sh</executable>
          <!-- For windows *.bat -->
     	  <!--<executable>pagerduty-alert.bat</executable>-->
    </action>
</custom-actions>

 Uncomment the appropriate executable tag based on windows or linux/unix machine.

 

4. Update the config.yaml file in <CONTROLLER_HOME_DIR>/custom/actions/pagerduty-alert/conf/ directory with the Service Key. You can also configure the level of details sent to PagerDuty.

Note : Please make sure to not use tab (\t) while editing yaml files. You may want to validate the yaml file using a yaml validator http://yamllint.com/

 

#PagerDuty Service Key
serviceKey: ""

#scheme used (http/https)
protocol: "https"

#PagerDuty host
host: "events.pagerduty.com"

#PagerDuty url path
urlPath: "/generic/2010-04-15/create_event.json"

#http timeouts
connectTimeout: 10000
socketTimeout: 10000

#show appdynamics details in pagerduty alert
showDetails: true

#public url for controller (http://<host>:<port> or https://<host>:<port>)
controllerUrl : ""

 

 

 

AppDynamics ParametersPagerDuty ParametersComments
 service_keyThis field is meant for the API key that is generated when a new service is created in a PagerDuty environment.
 event_typeThis field is used for all types of integration APIs available in PagerDuty. For this specific task we require that this parameter be set as "trigger".
APP_NAME
PVN_ALERT_TIME
SEVERITY
POLICY_NAME
AFFECTED_ENTITY_TYPE
AFFECTED_ENTITY_NAME
EVALUATION_TYPE
EVALUATION_ENTITY_NAME
SCOPE_TYPE_x
SCOPE_NAME_x
CONDITION_NAME_x
THRESHOLD_VALUE_x
OPERATOR_x
BASELINE_NAME_x
USE_DEFAULT_BASELINE_x
OBSERVED_VALUE_x
DEEP_LINK_URL
detailsSince there are certain limitations in the PagerDuty API in terms of the format of details that can be shown, this whole field is created as its own JSON object. The format is as follows for the following Policy Violation Parameters:
Variable name: Variable value
Application Name: APP_NAME
Policy Violation Alert Time: PVN_ALERT_TIME
Severity: SEVERITY
Name of Violated Policy: POLICY_NAME
Affected Entity Type: AFFECTED_ENTITY_TYPE
Name of Affected Entity: AFFECTED_ENTITY_NAME
Evaluation Entity #x
Evaluation Entity: EVALUATION_TYPE
Evaluation Entity Name: EVALUATION_ENTITY_NAME
Triggered Condition #x
Scope Type: SCOPE_TYPE_x
Scope Name: SCOPE_NAME_x
CONDITION_NAME_x OPERATOR_x THRESHOLD_VALUE_x (this is for ABSOLUTE conditions)
Violation Value: OBSERVED_VALUE_x
DEEP_LINK_URL
POLICY_NAMEdescriptionThis is the short description area that will be shown in the list view of PagerDuty incidents.

 

2. Install Custom Actions

 

To create a Custom Action using PagerDuty, first refer to the the following topic (requires login):

 

The custom.xml file and createPagerDutyAlarm directory used for this custom notification are located within the IntegrationsSDK/CustomNotification/alarming/ directory.

 

Place the createPagerDutyAlarm directory (containing params.sh and createPagerDutyAlarm.sh) along with the custom.xml file into the <controller_install_dir>/custom/actions/ directory.

 

3. Look for the newest created Incident in PagerDuty. Once an incident is filed it will have the following list view:

 

 

ListView.png

 

When the Details button of this window is clicked, it links to a similar page:

 

DetailsView.png

 

And finally, when viewing the event of the incident in JSON, it resembles the following:

 

EventView.png

 

 

Contributing

 

Always feel free to fork and contribute any changes directly via GitHub.

 

Support

 

For any questions or feature request, please contact AppDynamics Center of Excellence.

 

Version:

2.1

Compatibility:

3.7+

Last Update:

06/30/2015

 

 

1.0.0 - Release version

1.0.2 - Fixing bug in closing of events.

1.0.3 - Fixing java path in scripts

 2.0 - Fixed issues with controller 4.x.x and added link back to appdynamics.

 2.1 - Added support for POLICY_CANCELLED* events

 2.2 - Fixed the typo in POLICY_CANCELED

3.0.0 - Fixed log4j issues