Use case - AutoActions and Pagerduty
This topic explains how to configure Pagerduty and your Unravel server in order to receive AutoActionnotifications via Pagerduty.
The AutoAction's template provides the ability to send alerts via email to one or more recipients and/or create a HTTP endpoint allowing integration with a third party tool, e.g., Slack. These two options are specified when creating/editing an AutoAction. Once entered nothing further needs to be done for notifications to be sent.
Unravel has developed a third option allowing you to use Pagerduty to send notifications to one or more users through Unravel's AutoActions API.
Currently, this action is initiated outside of Unravel's server. For the integration you need to complete two (2) setups:
Set up a service at Pagerduty and specify who should be notified and how (email, etc.), and
Run a python script on your local machine, specifying the Unravel server and Pagerduty information.
Note
The python script must be running with the correct parameters in order for pagerduty to receive and forward notifications.
Set up a Pagerduty service
Login to your Pagerduty Account. Select the Configuration pulldown menu and chose Services. You can register at Pager Duty.
Select Add New Service.
Name the new service. Select Use our API directly and chose Events API v2 from the pull down menu.
Use the defaults for the remaining options and click Add Service.
Copy the Integration Key from the Service Details Integrations tab as you need it for Unravel's AutoActions API.
Run Unravel's API python script on your local computer
Download the Unravel demo program to the directory of your choice on your local machine.
# git clone https://github.com/Unravel-Andy/unravel-api-demo-v1
cd
tounravel-api-demo-v1
.# cd unravel-api-demo-v1 # ls README.md
Run the python script to bring up the Unravel API Demo window
Enter your Unravel Server's address in Unravel AutoActions API Address text box.
Note
The AutoActions API address has the form of
http[s]://UNRAVEL_HOST_IP/api/v1/autocactions
. Substitute a fully qualified DNS or IP address forUNRAVEL_HOST_IP
. In the example below the server ishttps://playground.unraveldata.com.
Enter the pagerduty integration key in the Pagerduty API key text box. Be sure to enter integration key correctly ensure a connection with Pagerduty. An incorrect key, or spaces around the key will prevent connecting with Pagerduty.
Click Start to populate the window with the defined AutoActions and their status. These are sorted on status first and then alphabetically in ascending order.
To scroll within list, click within the AutoAction Name list and scroll.
Open your browser and login to the Unravel Server you entered above.
Navigate to the AutoActions page (Manage | AutoActions). See Creating AutoActions if you don't know how to navigate to AutoActions. The Unravel UI shows the same list of active and inactive AutoActions listed in Unravel API window.
Both the Unravel API window and the Unravel UI shows the exact same list of AutoActions and their status. Toggle one of the AutoActions to see the effect.
In our example there were 2 active AutoActions, Kill job hogging the cluster and Rogue App AA #1. We deactivated Kill job hogging the cluster.
In the UI and Unravel API window, you will see the change.
Kill job hogging the cluster was moved to the inactive status/list in both the Unravel UI and Unravel AutoActions API window.
Updated Unravel UI
Updated Unravel API - In both screenshots below, Kill job hogging the cluster is shown inactive. The one on the left shows a successful connection to pagerduty, so notification was made. The shot on the right shows a failed connection with no notification made. The key was invalid because a space was added to the end of the string.
Pagerduty, upon receiving the status change information, will transmit it to the parties specified in the service detail.
Sample sms message
Sample email
Note
The python script must be running with the correct parameters in order for pagerduty to receive and forward notifications.