Cisco Webex for Alert Notifications

This article shows you how to receive ThousandEyes alert notifications in a Cisco Webex App space using webhooks.

  1. Create a new Webex bot: A Webex bot lets you integrate services into Webex. In the Webex App, create a new bot to receive alert notifications from the ThousandEyes webhook. For detailed instructions, see Creating a Webex Bot. Use the screenshots below to help you create your bot.

  2. Copy the bot's access token: After setting up your new Webex bot, copy the bot's access token and paste it somewhere handy. You'll need this token for the ThousandEyes integration.

  3. In Webex App, create a space to receive alert notifications from ThousandEyes: Skip this step if you already have a Webex App space where you'd like to receive alerts.

  4. Add the Webex App bot to the space: In this example, the bot named "ThousandEyes Custom Webhook Test" is added to the "ThousandEyes-Webhook-Test" Webex App space.

  5. Copy the space's roomId: You'll use the roomId with the bot's access token (from Step 2) to configure the ThousandEyes integration. Now that the Webex bot is a member of your Webex App space, look up the roomId of your Webex App space and copy it. To find the roomId:

  6. Create a new alert integration: From the ThousandEyes app, create a new alert integration using custom webhooks. The webhook integration sends alert notifications to the Webex App bot. The Webex App bot publishes these notifications as messages in the Webex App space. To create a new alert integration:

    • Navigate to Integrations.

    • Click + New Integration.

    • Select Custom Webhook.

  7. Configure your custom webhook to work with Webex App: ThousandEyes custom webhooks offer a preset configuration that populates the fields with the settings you need to integrate with Webex App. In the Preset Configurations field, select Cisco Webex.

  8. Fill out the other fields as follows:

    • Name: Example: "Webex App Test"

    • URL: Use the url for Webex App Messages: "https://webexapis.com/v1/messages"

    • Auth Type: Token

    • Bearer Token: Use the Webex App bot's access token (see Step 2)

    • Headers: Content-Type application/json

    • Body: Add the roomId (see Step 5) to the JSON content in the Body field, before the line that says "markdown". To do this, create a new line, then add the following text:"roomId" : "<yourWebex App space roomId>". Replace <yourWebex App space roomId> with the roomId from Step 5. The final result should look something like the entry below:

    {
       "roomId" : "12345abcde67890fghij",
       "markdown" : "<strong>ThousandEyes Alert{{#eq type.id 2}} Triggered{{else}} Cleared{{/eq}}{{#if alert.test}} for {{alert.test.name}}{{/if}}</strong>\n<strong>Alert ID:</strong> {{alert.id}}{{#if alert.test}}\n<strong>Test Name:</strong> {{alert.test.name}}\n<strong>Target/s:</strong> {{#each alert.targets}}{{description}}{{#unless @last}} {{/unless}}{{/each}}{{/if}}\n<strong>Alert Rule:</strong> {{alert.rule.name}} - {{formatExpression alert.rule.expression}}{{#if alert.details}}\n<strong>Details:</strong> {{alert.details.size}}{{/if}}\n<strong>Severity:</strong> {{alert.severity.display}}\n<strong>Alerts Link:</strong> https://app.thousandeyes.com/alerts/list/active"
    }
  9. Test the integration: At the bottom of the Add Custom Webhook Integration screen, click Test.

    A successful test returns the message Testing completed successfully! HTTP status: OK (200), as shown above.

  10. Verify that the "Sample Test" message shows up in the Webex App space.

  11. Click the Save button to save the integration.

    If the test fails, click Save to save the integration; then re-open the integration and test it again. If the test still fails, verify that the webhook URL in the ThousandEyes custom webhook matches the incoming Webex App webhook.

  12. Apply the new integration to your alert rules: Do this using the resulting Manage Alert Rules side panel.

For more information on configuring webhooks, see Custom Webhooks.

Last updated