To create a webhook action
The details required to create an action vary depending on the action type. For example, you will need the OpsGenie API key for sending data, but only valid email addresses for sending email notifications.
- From the top right of the screen, click > Notifications to access the actions and alarms.
- From the Actions tab, click Create Action.
- Type a unique Name for the action.
- Select webhook from the Action Type drop-down list.
Select the HTTP Method (POST, PUT, GET, or DELETE) of the endpoint for the specified webhook URL.
Type the complete Webhook URL that needs to be invoked.
HTTP and HTTPS are supported. However, for HTTPS URLs, only certificates issued from a Trusted Certificate Authority are supported.
For example, http://host.com/path or https://host.com/path.
- Type the Username and Password for authentication.
Leave both the fields blank if basic authentication is not required. If you selected the POST data (or PUT) method, you can type the payload in a valid JSON format to be sent as part of the request.
Note
The payload will be ignored if the HTTP Method is set to GET or DELETE.
If invalid JSON is found, “INVALID-JSON” will be sent with the request.
In the JSON string, you can provide parameters which are replaced before making the request to the URL. Provide the parameters in the following format to replace them successfully - ${param-name}. When the string is encountered in the JSON string, it is replaced with its value and available as part of notification. If the parameter is not set for this notification then the value is displayed as “NOTSET”.
For example,
{
“key1” : “Value1”,
“AppId” : “${appId}”,
“Source” : “${source}”
}
The following table lists parameters that you can use.
Valid parameters appId
eventId
severity
closedTime
metric
source
createdTime
notes
state
entityTypeId
product
status
eventClass
ruleDesc
tenantId
eventDesc
ruleId
title
- Click Save.
Where to go from here
After creating an action, you can either create another action or create an alarm.
Comments
Log in or register to comment.