Use of custom actions for HTTP based integrations is no longer supported. Please look at HTTP Request Templates on how HTTP based integrations can be done. For sample HTTP templates, please check this article.
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.
You should have a PagerDuty Service Key
<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 and PagerDuty Parameters Mapping
|AppDynamics Parameters||PagerDuty Parameters||Comments|
|service_key||This field is meant for the API key that is generated when a new service is created in a PagerDuty environment.|
|event_type||This 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".|
|details||Since 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:|
|POLICY_NAME||description||This is the short description area that will be shown in the list view of PagerDuty incidents.|
5. Please refer to the following docs to create a Custom Action
Now you are ready to use this extension as a custom action. In the AppDynamics UI, go to Alert & Respond -> Actions. Click Create Action. Select Custom Action and click OK. In the drop-down menu you can find the action called 'pagerduty-alert'.
A policy has to be associated with this action for it to be triggered. Refer the docs below
6. Look for the newest created Incident in PagerDuty. Once an incident is filed it will have the following list view:
When the Details button of this window is clicked, it links to a similar page:
And finally, when viewing the event of the incident in JSON, it resembles the following:
Always feel free to fork and contribute any changes directly via GitHub.
For any questions or feature request, please contact AppDynamics Support.
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
3.1 - Fixed java path issues
3.2 - Updated Licenses