Webhook Integrations with Third-Party Apps
This page provides sample configuration for Eggplant Monitoring Webhook with third party applications.
Slack
To integrate Incoming Webhooks in Slack, follow these steps:
- Go to the Configure apps section from your Slack instance by clicking
https://<your workspaces.slack.com/account/settings
. - Search for Incoming Webhooks in the Apps directory of Slack. If no Incoming Webhooks are found, then create one for the Slack app by following the Slack Incoming Webhooks documentation. You may need to contact your IT administrator to approve the Webhook app based on your Slack workspace configuration (see the Slack docs for more information).
- After creating the app, go back to your Slack Account > Configure apps section and search for the newly created Incoming Webhooks app.
- Select the app and enable the incoming-webhook for posting messages to a channel or individual. This will generate an Incoming Webhook URL. To get approval for this process, you may need to contact your IT administrator. Here is an example URL for an Incoming Webhook in Slack:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
- Create a new Webhook Profile with the Error and Recovery Payloads.
Error Payload
{
"text": "{{error-summary}} ({{error-ref}})\n>>>Script: {{error-source}}\nError: {{error-description}} ({{error-result-code}})\nSeverity: {{error-severity}}\nState: {{error-state}}\nEnvironment: Eggplat Monitoring\n To check the status of this error and view further information, <{{error-url}}|click on this link>!",
}
Recovery Payload
{
"text": "{{error-summary}} ({{error-ref}})\n>>>Script: {{error-source}}\nError: {{error-description}} ({{error-result-code}})\nSeverity: {{error-severity}}\nState: {{error-state}}\nEnvironment: Eggplat Monitoring\n To check the status of this error and view further information, <{{error-url}}|click on this link>!",
}
For example, this is how incoming Webhook notifications in Slack appear:
PagerDuty
To integrate Webhooks notifications in PagerDuty, follow these steps:
- Set up the Pagerduty integration for your service by following these instructions.
- Copy the PagerDuty integration Key for the service you are monitoring, which will be used as
routing_key
in the Error and Recovery payload. - If you're using Event API V2, create the Webhook profile using the URL:
https://events.pagerduty.com/v2/enqueue
. For more information about Event API V2, see the PagerDuty Developer Guide. - Use the same PagerDuty Integration Key as the
routing_key
in the Error and Recovery payload when creating the Webhook Profile.
Error Payload
{
"payload": {
"summary": "{{error-severity}} | {{error-source}}",
"source": "{{error-source}}",
"severity": "error",
"class": "{{error-description}}",
"custom_details": {
"alertsummary": "{{error-summary}}",
"alertsource": "{{error-source}}",
"alertseverity": "{{error-severity}}",
"alertresultCode": "{{error-result-code}}",
"alertdescription": "{{error-description}}",
"alerterrorreference": "{{error-ref}}",
"alerterrorurl": "{{error-url}}",
"alertstate": "{{error-state}}",
"environment": "Eggplant Monitoring"
}
},
"routing_key": "03bfc5b40e0b4b83a6f535984aa76fa4",
"event_action": "trigger",
"dedup_key": "{{error-ref}}",
"client": "Eggplant Monitoring",
"client_url": "{{error-url}}",
"images": [{
"src": "https://portal.hub.eggplant.cloud/common/image/ncc/eggplant-logo.png",
"href": "https://portal.hub.eggplant.cloud/hub/login.php",
"alt": "Eggplant"
}],
"links": [{
"href": "{{error-url}}",
"text": "To check the status of this error and view further information, click on this link"
}]
}
Recovery Payload
{
"payload": {
"summary": "{{error-severity}} | {{error-source}}",
"source": "{{error-source}}",
"severity": "error",
"class": "{{error-description}}",
"custom_details": {
"alertsummary": "{{error-summary}}",
"alertsource": "{{error-source}}",
"alertseverity": "{{error-severity}}",
"alertresultCode": "{{error-result-code}}",
"alertdescription": "{{error-description}}",
"alerterrorreference": "{{error-error-ref}}",
"alerterrorurl": "{{error-url}}",
"alertstate": "{{error-state}}",
"environment": "Eggplat Monitoring"
}
},
"routing_key": "03bfc5b40e0b4b83a6f535984aa76fa4",
"event_action": "resolve",
"dedup_key": "{{error-ref}}",
"client": "Eggplant Monitoring",
"client_url": "{{error-url}}",
"images": [{
"src": "https://portal.hub.eggplant.cloud/common/image/ncc/eggplant-logo.png",
"href": "https://portal.hub.eggplant.cloud/hub/login.php",
"alt": "Eggplant"
}],
"links": [{
"href": "{{error-url}}",
"text": "To check the status of this error and view further information, click on this link"
}]
}
When a failure is detected in Eggplant Monitoring, the Error Webhook will trigger a new incident in PagerDuty. After the error is recovered, this webhook will then send a recovery notification which will automatically resolve the incident in PagerDuty.
MS Teams
To integrate Webhooks notifications within MS teams, follow these steps:
- Create a webhook connector by following the MS teams Webhooks and connectors guide.
- Copy the URL and create the Webhook profile using the URL with the sample Error and Recovery payload. Add an integration for the service with the Error and Recovery Payloads as described below.
Error Payload
{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"themeColor": "994444",
"summary":"EggPlant Alert: {{error-state}} for {{error-source}}",
"sections": [
{
"facts": [
{
"name": "Summary:",
"value": "{{error-summary}}"
},
{
"name": "State:",
"value": "{{error-state}}"
},
{
"name": "Source:",
"value": "{{error-source}}"
},
{
"name": "ResultCode:",
"value": "{{error-result-code}}"
},
{
"name": "Description:",
"value": "{{error-description}}"
},
{
"name": "Error Severity:",
"value": "{{error-severity}}"
},
{
"name": "ErrorRef:",
"value": "{{error-ref}}"
},
{
"name": "Link to EggPlant Error Report:",
"value": "To check the status of this error and view further information, [click on this link]({{error-url}})"
}
]
}
]
}
Recovery Payload
{
"@type": "MessageCard",
"@context": "https://schema.org/extensions",
"themeColor": "994444",
"summary":"EggPlant Alert: {{error-state}} for {{error-source}}",
"sections": [
{
"facts": [
{
"name": "Summary:",
"value": "{{error-summary}}"
},
{
"name": "State:",
"value": "{{error-state}}"
},
{
"name": "Source:",
"value": "{{error-source}}"
},
{
"name": "ResultCode:",
"value": "{{error-result-code}}"
},
{
"name": "Description:",
"value": "{{error-description}}"
},
{
"name": "Error Severity:",
"value": "{{error-severity}}"
},
{
"name": "ErrorRef:",
"value": "{{error-ref}}"
},
{
"name": "Link to EggPlant Error Report:",
"value": "To check the status of this error and view further information, [click on this link]({{error-url}})"
}
]
}
]
}
Sample MS Teams Incoming Webhook Notifications
Jira Integration
- Create a Jira API basic token using the Jira Integrations Guide.
- Create a Webhook with your Jira API URL.
- Use the token as the Request Header in the Webhook configuration.
Authorization: Basic <<mysecuretoken>>
Content-Type: application/json
- Use the sample Error for sending Webhook notifications to Jira API.
{
"fields": {
"issuetype": {
"id": "15"
},
"project": {
"key": "MyTestProject"
},
"description": "Error ref.: {{error-ref}}\n\nUrl: {{error-url}}nnDescription: {{error-description}}",
"summary": "{{error-source}}: {{error-severity}} - Result Code {{error-result-code}}"
}
}