You must configure the PEM Server to use webhooks to receive notification of alert events on threshold value violations in your configured applications.
Creating a webhook
PEM monitors your system for conditions that require user attention. You can use a webhook to create the endpoints to receive a notification if current values deviate from threshold values specified in an alert definition. Based on the events triggered, PEM sends a notification to multiple webhook endpoints or to specific target webhook endpoints.
Use the Webhooks tab to configure endpoint recipients. To open the Webhooks tab, select Management > Alerts > Manage Alerts. From the Manage Alerts tab, on the Quick Links toolbar, select Webhooks.
The Webhooks tab displays a list of the currently defined recipient applications as endpoints. Select an endpoint and select Edit at the far left end of the row to modify an existing endpoint.
To define a new webhook, select the plus sign (+) in the upper-right corner of the table. You can then use the General tab to define the basic details of the webhook:
- Provide a name for the webhook in the Name field.
- Specify a webhook URL to deliver all the notifications to in the URL field.
- Set the request method type used to make the call in the Request Method field: POST or PUT.
- By default, webhooks are enabled. To disable a webhook, set Enable? to No.
Note
The Enable? setting works only if the enable_webhook parameter is set to true in the agent.cfg file. By default, the enable_webhook parameter is set to true only for the agent running on the PEM server host. For all other agents running on other hosts, you need to set it to true manually.
Defining webhook SSL configurations
You can define the webhook SSL parameters in the respective agent configuration file or registry in Windows. You can find the list of webhook SSL parameters in PEM agent configuration parameters. If you add or remove any of the agent configuration parameters, you must restart the agent to apply them.
- On Windows systems, PEM registry entries for webhooks are located in
HKEY_LOCAL_MACHINE\Software\EnterpriseDB\PEM\agent\WEBHOOK. - On Linux systems, PEM configuration options for webhooks are stored in the
agent.cfg file, located by default in/usr/edb/pem/agent/etc.
Defining webhook headers
Use the HTTP Headers tab to define the header parameters to pass while calling the webhook endpoints:
- Specify all the values as a key and value pair.
- Specify a key parameter in the Key field and a value in the Value field.
- To add HTTP headers, select the plus sign (+) in the upper-right corner of the HTTP Headers table.
- To delete HTTP headers, select Delete to the left of Key. The header remains in the list but in strike-through font. Select Save to permanently delete the headers.
- To edit the HTTP headers, select Edit to the left of Key.
Defining webhook payloads
Use the Payload tab to define the JSON data to send to the endpoint when an alert is triggered:
Type specifies data to send in the format type, that is, JSON.
Use Template to configure JSON data sent to endpoints. In the template, you can use placeholders for the following:
%AlertID%— The id of the triggered alert.%AlertName%— The name of the triggered alert.%ObjectName%— The name of the server or agent on which the alert was triggered.%ObjectType%— The type on which the alert was generated.%ThresholdValue%— The threshold value reached by the metric when the alert triggered.%CurrentValue%— The current value of the metric that triggered the alert.%CurrentState%