How to Integrate AppDynamics & PagerDuty
The AppDynamics application allows you to create notifications, based on thresholds defined by the user, that can be used to trigger incidents within PagerDuty. PagerDuty can then alert the appropriate technician via SMS, phone, email or iOS push. If you are having trouble completing the installation, please contact us.
This guide is designed for integration with AppDynamics 3.6.
Create a new service:
- In your account, under the Services tab, click “Add New Service”.
- Enter a name for the service and select an escalation policy. Then, start typing “AppDynamics” for the Integration Type, which will narrow your filtering.
- Click the “Add Service” button.
- Once the service is created, you’ll be taken to the service page. On this page, you’ll see the “Service key”, which you will need when you configure AppDynamics to send events to PagerDuty.
- This walkthrough assumes that AppDynamics has already been installed, configured and is communicating properly with your application(s).
- Download and extract pagerduty.tar.gz
- Extract pagerduty.tar.gz with the following command:
tar -zxvf pagerduty.tar.gz
Inside you will find a folder named createPagerDutyAlarm and a file named custom.xml.
- Navigate to the createPagerDutyAlarm folder and open params.sh in your preferred text editor.
- Insert the Service API Key obtained from PagerDuty into: API_KEY=””.
- At the top level of the Controller install directory, create a directory named “custom” and a sub-directory named “actions”.
- Place the createPagerDutyAlarm/ directory (containing params.sh and createPagerDutyAlarm.sh ) along with the custom.xml file into the <controller_install_dir>/custom/actions/ directory, if it does not exist already. If it does, manually merge the contents of custom.xml and refer to our documentation here if you have any issues.
- Within AppDynamics, click on Configure > Global Notifications.
- Click the + NEW button.
- The Create Notifications window opens.
- Enter a name for the custom notification (e.g. PagerDuty).
- Check the Enabled box to enable the notification.
- Set the Severity to Critical.
- Select 10 minutes for the Notification Interval.
- Check the problems and informational events for which the notifications will be sent.
- Click on the Recipients + icon.
- The Add Notification window appears.
- Select Custom from the Type drop-down menu.
- Select createPagerDutyAlarm from the Custom Action drop-down menu.
- Enter a tag (e.g. PagerDutyAlarm).
- Click the Add Notification button.
- Click Save.
Verify that AppDynamics and PagerDuty are Communicating
Once an alert has been created within AppDynamics, you can verify that PagerDuty triggered a new incident by doing the following:
- Login to your PagerDuty account.
- Click on Services and then select the service that’s used for monitoring your AppDynamics application.
- You should see that an incident has been triggered.
- You can then click on the incident number to view the incident details.
- Lastly, click on view message to see the JSON information passed from AppDynamics.
How do you configure AppDynamics to have multiple alerts that report to PagerDuty?
You can also setup AppDynamics so that it will report to multiple PagerDuty services. This can be useful if you have multiple applications running within AppDynamics or if you would like to use specific escalation policies and on-call schedules for different AppDynamics notifications. In order to setup AppDynamics so that it can communicate with multiple PagerDuty services, you will:
- Create two (or more) PagerDuty Generic API services.
Each service will have its own Service API key.
- Create multiple subfolders under the <controller_install_dir>/custom/actions/ directory.
Each folder would contain the same contents as described in steps 6-7 of these instructions with one caveat: Each params.sh file will contain a different Service API Key. Lastly, modify your <controller_install_dir>/custom/actions/custom.xml file to point to each of your new scripts. You now will have two (or more) options when selecting a custom action as described in step 16. Note: For more advanced information regarding custom actions in AppDynamics, please review the documentation here.