Skip to content

Commit

Permalink
Merge pull request #5760 from EnterpriseDB/docs/edits_to_pem_pr5258
Browse files Browse the repository at this point in the history
Edits to PEM Add Using Webhooks to PEM documentation #5258
  • Loading branch information
nidhibhammar authored Jun 19, 2024
2 parents a76f22c + 489b836 commit 6557fd1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions product_docs/docs/pem/9/monitoring_performance/notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,33 +140,33 @@ Use the **Notifications** tab to specify an alert level for webhook endpoints:
- Set **All alerts** to **Yes** to enable all alert levels to send notifications.
- To send a notification when a specific alert level is reached, set the slider next to an alert level to **Yes**. You must set **All alerts** to **No** to configure an individual alert level.

### Example: sending notifications to Slack
### Example: Sending notifications to Slack

In Slack, follow the instructions in [Getting started with incoming webhooks](https://api.slack.com/messaging/webhooks) to:
- Create a Slack app
- Activate incoming webhooks for that app
- Add a webhook that posts to a channel or user of your choice
- Create a Slack app.
- Activate incoming webhooks for that app.
- Add a webhook that posts to a channel or user of your choice.

The newly created webhook will have a unique URL something like https://hooks.slack.com/services/x/y/z . We can now configure PEM to send notifications to this URL.
The new webhook has a unique URL similar to `https://hooks.slack.com/services/x/y/z`. You can now configure PEM to send notifications to this URL.

In PEM, [create a new webhook](#creating-a-webhook), give it a descriptive name and copy the URL you obtained above to the 'URL' field.
Ensure that 'Request method' is set to 'POST' and 'Enable?' is set to 'Yes'. Set all the sliders under 'Alert Notifications' to 'Yes'.
In PEM, [create a new webhook](#creating-a-webhook), give it a descriptive name, and copy the URL you obtained earlier to the **URL** field.
Ensure that **Request method** is set to **POST** and **Enable?** is set to **Yes**. Set all the sliders under **Alert Notifications** to **Yes**.

Add a header under HTTP headers with the key `Content-Type` and the value `application/json`.

Under Payload, delete the default template and specify a template with `text` as the top-level key as in the example below.
Under **Payload**, delete the default template and specify a template with `text` as the top-level key as in the following example:

```
{"text": "%AlertName% on %ObjectType% %ObjectName% is now %CurrentState%"}
```

You can now test the connection. If it succeeds, you will get a notification in PEM, and the template above will appear in your Slack channel as a message.
You can now test the connection. If it succeeds, PEM issues a notification, and the template you specified appears in your Slack channel as a message.

Save the webhook and continue using PEM as usual. Now, PEM will send all the alerts to your Slack channel.
Save the webhook and continue using PEM as usual. PEM now sends all the alerts to your Slack channel.

### Deleting a webhook

To mark a webhook for deletion, in the Webhooks table, select the webhook name and select **Delete** to the left of the name. The alert remains in the list but in strike-through font.
To mark a webhook for deletion, in the Webhooks table, select the webhook name and select **Delete** to the left of the name. The alert remains in the list but in strikethrough font.

**Delete** is a toggle. You can undo the deletion by selecting **Delete** a second time. Select **Save** to permanently delete the webhook definition.

Expand Down

1 comment on commit 6557fd1

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.