With Cloud Notify you receive real-time notifications from your machine(s) in a robust and safe way. By connecting an external application via a webhook, you can expand your options even further. Using the webhook PagerDuty, you can further customize alarm messages and determine specific roles for the alarm messages of Cloud Notify.
PagerDuty is an industrial incident response platform and can notify via phone, SMS, e-mail and push messages. Furthermore, you can also provide “On-call schedules” to specify shifts or timetables, so you will only receive notifications during your shift.
The use of webhooks in the StrideLinx Cloud is free. However, keep in mind that applications such as PagerDuty may charge a fee when using their services.
This article explains how you connect the StrideLinx Cloud to PagerDuty via a webhook.
How it works
Based on the alerts in the StrideLinx Cloud, PagerDuty notifies the right recipients, by sending enriched event data, including customized long content. The StrideLinx Cloud uses webhooks to send HTTP POST message events to an endpoint in PagerDuty. When PagerDuty receives such a message event, it will trigger an incident to notify users on-call, based on your configuration.
Integration walkthrough
The integration is configured in both the StrideLinx Cloud and the PagerDuty website. First we'll add a service in Pagerduty:
Required permission
In PagerDuty you require a Manager role or higher for the service your StrideLinx Cloud is integrated with. If you do not have this role, please reach out to an admin or Account Owner within your organization to configure the integration.- From the [Configuration] menu, select [Services].
- On your Services page: click [+Add New Service].
- Give the Service a [Name], select [Customer Event Transformer] from the [Integration type] menu and enter an [Integration name].
Make sure to set How should responders be notified under Incident Settings to Use alert severity to determine how responders are notified for each incident. This enables you to specify the Pagerduty urgency of a StrideLinx Cloud alarm. You can customize these settings to meet your wishes.
After adding the Service use the Event Rules tab to create these event rules. If you follow these settings only alarms with systemLabels alarm-high and alarm-medium will generate a High Urgency incident. Alarms with systemLabel alarm-low will generate a Low Urgency incident. Each user can personally specify how they are notified for each urgency. By default a High Urgency Incident sends an email, calls you and sends an sms. A Low Urgency Incident only sends an email. You can customize these settings to your liking.
We have to add some custom code so PagerDuty can understand the data it receives from the StrideLinx Cloud.
- Use the [Edit] action on your Custom Event Transformer.
- Copy-paste the following code as is depicted below.
var input = PD.inputRequest.body;
var normalized_event = { event_type: PD.Trigger, description: input.shortContent, client: "StrideLinx Cloud", client_url: "https://stridelinx.com/messages/", details: input };
PD.emitGenericEvents([normalized_event]);
- After saving the changes, copy the Integration URL.
Now that the part concerning PagerDuty is done, we can proceed with configuring the StrideLinx Cloud. Please follow the steps described below to add a webhook URL in the StrideLinx Cloud:
- Go to the StrideLinx Cloud. if you are not already there.
- Go to Messages
, press on the settings menu
.
- Select [Configure webhooks], then select [Add a new webhook]
- Enter the name and URL of the Webhook you want to add, then press [Confirm].
- Set up an alarm and alarm trigger it to test if a message is sent to PagerDuty.
The message will be sent to PagerDuty and a new incident will be created.
PagerDuty and the StrideLinx Cloud are now integrated
New alarm messages in the StrideLinx Cloud will now be sent to and handled by PagerDuty.
Please refer to PagerDuty's documentation on how to best utilise their wide range of functions.