Automated Diagnostics
Automated Diagnostics
Integrating with Automation Actions
The prebuilt Jobs in the Automated Diagnostics solution are designed to be invoked from Automation Actions, though they can be invoked from within the Runbook Automation interface as well.
Heads Up
The steps for configuration differ for Runbook Automation SaaS and Runbook Automation Self-Hosted. Be sure to select the correct tab below for the applicable instructions.
Create a Runbook Automation API Key
- Click on the User Icon in the upper-right and click on Profile.
- To the right of User API Tokens, click +:
- Enter a name for the API token and click Generate New Token.
- Copy the User API Token and keep it in a safe place for later use.
Create an Action Runner
Next, you will add a new runner in PagerDuty to connect to Runbook Automation.
- In PagerDuty, navigate to Automation -> Automation Actions -> Runners tab -> +Add Runner
- Select Runbook Automation as the type of Runner and click Next
- Enter a Name and Description and click Next
- On the following screen, enter your Runbook Automation Subdomain and the API key you saved previously. Optionally, associate with specific teams to limit who can use this Runner.
- Click Create Runner
- Check the runner’s status in PagerDuty
A green checkmark indicates that the connection to your Runbook Automation instance was configured correctly.
A red circle indicates that the connection was unsuccessful. In this case, make sure you typed the subdomain and API Token correctly.
Define an Action
- In PagerDuty, navigate to Automation -> Rundeck Actions -> Add Action:
- Select your Runner and click Next
- Select the Third Party Service Disruptions job from those listed and click Next
- Review and update the Action Name and Description if desired.
- Select one or more Services. This controls which incidents will have this action.
- If desired, select one or more Teams. This limits access for this action to members of those teams. Leave blank to make universally available in the selected services.
- Click Next
- Insert
-pd_incident_id ${pagerduty.incidentId}
into the Enter arguments field. - Click Create Action. This Automated Action can now be invoked from an incident or from Event Orchestration:
Heads Up
Although the Action can be invoked from PagerDuty, the output of the Job will not yet appear on the Incident Timeline.
Continue on to the next section to complete the setup
Create a PagerDuty API Key
In the PagerDuty web app:
- Navigate to Integrations -> API Access Keys and click Create New API Key.
- Enter a Description that will help you identify the key later on. If you would like it to be read-only, check the Read-only option.
- Click Create Key.
- A unique API key will be generated. Copy it to a safe place, as you will not have access to copy this key again. Once it has been copied, click Close.
- If you lose a key you will need to delete it and create a new one.
Create a Runbook Automation API Key
- Click on the User Icon in the upper-right and click on Profile.
- To the right of User API Tokens, click +:
- Enter a name for the API token and click Generate New Token.
- Copy the User API Token and keep it in a safe place for later use.
Create an Action Runner
In PagerDuty
Next, you will add a new runner to generate an ID and secret.
- In PagerDuty, navigate to Automation -> Automation Actions -> Runners tab -> +Add Runner
- Select Runbook Automation as the type of Runner and click Next
- Enter a Name and Description and associate with Teams if desired. Then click Next.
- On the following screen, click Download ID & Secret to download the file
credentials.pdrunner-creds
, and click Create Runner.
In a text editor
- Open
credentials.pdrunner-creds
in your preferred text editor, replace<API_Token>
with the PagerDuty API key from step 4 above. - Add a line
rundeck_url:
followed by your Runbook Automation URL and a line withrundeck_token:
followed by your Runbook Automation API Token:
id:XXXXXXXXXXXXXXXXXXXXXXX3P1C
secret:XXXXXXXXXXXXXXXXXXXX2I4B
token:<PagerDuty_API_TOKEN>
rundeck_url: https://<your_account>.pagerduty.runbook.cloud
rundeck_token: <Your_Saved_Process_Automation_API_TOKEN>
On your Runner machine
Install Java 11+ on the machine that will host the runner. We recommend Linux (Ubuntu 18) or higher. If the operating system is reasonably new, it is recommended to perform an update:
- Update the Ubuntu version
sudo apt-get update
- Install the open source Java version that the runner uses
sudo apt install openjdk-11-jre-headless
- Create a folder in a preferred directory on your system to place the credentials files
mkdir automation_runner
- Navigate into the runner’s directory
cd automation_runner
- Insert the credentials file with your updates
- Rename the file to .pdrunner-creds
mv credentials.pdrunner-creds .pdrunner-creds
- Download the latest runner software from PagerDuty
wget https://runbook-actions.pagerduty.com/pd-runner.jar
- View current directory to see all of the files. You should see two files
ls -larths
- Launch pd-runner
java -jar pd-runner.jar &
- [Optional] Verify activity in
runner.log
.tail -f /home/ubuntu/automation_runner/runner/logs/runner.log
- Check the runner’s status in PagerDuty.
A green checkmark indicates that the runner is active and running successfully.
A red circle indicates that the runner is not running or there is a problem with the runner. Please verify your Java 11+ installation and check the local runner logs, or refer to our FAQ.
Define an Action
- In Runbook Automation, click on Third Party Service Disruptions in your Jobs list.
- Click on the clipboard icon next to the job's UUID. This will copy the Job ID to your clipboard:
- In PagerDuty, navigate to Automation -> Rundeck Actions -> Add Action:
- Select the Runner you installed from the list of installed runners and click Next.
- Create an Automation Action
- Type and Category
Select type: Select Runbook Automation
Select category: Diagnostic - Define your action
Enter Runbook Automation Job ID:
Paste the Job UUID you copied from the Runbook Automation server
Enter Runbook Automation arguments:-pd_incident_id ${pagerduty.incidentId}
- Name and description
Enter the desired Name (such as Third Party Service Disruptions) and Description - Associate with Service(s)
Select one or more Services. This controls which incidents will have this action. - Associate with team(s)
If desired, select one or more Teams. This limits access for this action to members of those teams. Leave blank to make universally available in the selected services.
- Type and Category
- Click Create Action. This Automated Action can now be invoked from an incident or from Event Orchestration:
Heads Up
Although the Action can be invoked from PagerDuty, the output of the Job will not yet appear on the Incident Timeline.
Continue on to the next section to complete the setup