Alerts - Slack

Objective

This document provides instructions on how to configure alert notifications in F5® Distributed Cloud Services to route the alert messages to your Slack channel. For information on alerts, see Alerts.


Prerequisites

Note: If you do not have an account, see Create an Account.

  • A Slack account with administrative privileges to integration settings.

Configuration

Configuring to send alerts to a Slack channel requires you to first generate webhook for your Slack channel. After that, create alert receiver, policy, and policy set in the F5® Distributed Cloud Console.

Configuring to send alerts to the Slack channel requires you to create alert receiver, policy, and policy set in the VoltConsole.

Create Webhook for Slack Channel.

This example shows instructions on generating the webhook configuration for a Slack channel.

Step 1: Generate webhook configuration from Slack.

Log into your enterprise Slack portal, follow instructions in the Incoming Webhooks for Slack page to generate the webhook for the channel to which you want to post the alerts.

Step 2: Obtain URL from generated webhook configuration in Slack.
  • Navigate to your application settings on Slack, obtain webhook URL under the Webhook URLs for Your Workspace section.

  • This example shows a sample webhook settings on Slack.

WhSlack
Figure: Slack Incoming Webhook URL


Create Alert Receiver

Alerts can be created in different services and namespaces. Alert functionality is available in Cloud and Edge Sites, Load Balancers, Web App & API Protection, Distributed Apps, Audit Logs and Alerts, and Shared Configuration.

This example shows alert notifications for Slack setup in Shared Configuration.

Step 1: Start Alert Receiver creation in F5® Distributed Cloud Console.
  • Open F5® Distributed Cloud Console homepage, select Shared Configuration box.

Note: Homepage is role based, and your homepage may look different due to your role customization. Select All Services drop-down menu to discover all options. Customize Settings: Administration > Personal Management > My Account > Edit work domain & skills button > Advanced box > check Work Domain boxes > Save changes button.

NEW HOME PAGE C
Figure: Alert Homepage

Note: Confirm Namespace feature is in correct namespace, drop-down selector located in upper-left corner. Not available in all services.

  • Select Manage in left column menu > select Alerts Management > Alert Receivers.

Note: If options are not showing available, select Show link in Advanced nav options visible in bottom left corner. If needed, select Hide to minimize options from Advanced nav options mode.

  • Select + Add Alert Receiver button.

ALERTRECIEVER2
Figure: Alert Receiver

Step 2: Configure Alert Receiver.
  • Enter Name, enter Labels and Description as needed.

  • Select Slack in Receiver drop-down menu.

ALERTSRECEIVER 2
Figure: Alert Policy Configuration

Step 3: Configure secret for receiver.
  • Select Configure in Webhook URL box.

Note: This opens the alert receiver secret configuration form.

  • Select Blindfold Secret in Secret info drop-down menu.

  • Select Blindfold in Type field.

  • Enter string obtained from applying Blindfold to webhook configuration.

  • See Blindfold your Application Secrets for information on how to encrypt your application secrets.

  • Select Apply.

ALERTSRECEIVER 5
Figure: Alert Receiver Secret Configuration

Note: You can also select other values for the Secret info field, and set the subsequent values as per the following guidelines.

Secret Guidelines
Vault Secret Enter the values for the provider and location.
Clear Secret Enter the value for the URL in the string:///<string> format.
Bootstrap Secret Enter the name of the secret.
It is recommended to encode your secret using the Base64 encryption, and set the secret encoding as Base64. However, in case of clear secret, select the encoding as EncodingNone.
You can apply Base64 encoding to the webhook URL using the `echo -n base64` command.
Step 4: Configure Slack channel, complete creating receiver.
  • Enter channel name of Slack channel (to which you want to send the alerts).

  • Select Save and Exit button to complete creating the alert receiver.

ALERTSRECEIVER 3
Figure: Alert Receiver Configuration


Create Alert Policy

Step 1: Create Alert Policy.
  • Select Manage > Alerts Management > Alert Policies.

  • Select + Add Alert policy button.

ALERTSRECEIVER 1
Figure: Create Alert Policy

Step 2: Add receiver to policy.
  • Enter Name for policy.

  • + Select Receiver button to open the receiver selection form.

  • Select box of receiver you created in Create Alert Receiver section.

  • Select Receiver button to add receiver to policy.

ALERTPOLICY 3
Figure: Alert Policy Receiver Configuration

Step 3: Optionally, configure notification intervals.
  • Enable Show Advanced Fields option in Alert Receiver Configuration section.

  • Select Configure link in Receiver Default Notification Parameters section. This opens notification parameter configuration.

  • Enter configuration for the Notification Parameters.

    • Toggle Show Advanced Fields in both sections to open configuration options.

    • Enter a value in the [0-9][smhd] format in Notify Interval for a Alert. The [smhd] specifies seconds, minutes, hours, and days. An example value is 60m and default is 4h.

    • Enter a value in the [0-9][smhd] format in Wait to Notify. The [smhd] specifies seconds, minutes, hours, and days. An example value is 2m and default is 30s.

    • Enter a value in the [0-9][smhd] format in Notify Interval for a Group. The [smhd] specifies seconds, minutes, hours, and days. An example value is 5m and default is 1m.

    Note: All fields must be in 2-digit form (60m, 60s) in Policy Rule Notification Parameters for intervals, and group notifications for your policy rules to apply correctly and not error.

ALERTPOLICY PARAMETERS
Figure: Alert Policy Route Configuration

  • Select Apply to apply the notification parameters, and return to the policy configuration.
Step 4: Optionally, configure policy rules.

A minimum of one policy rule is populated by default with Any as match condition and Send as Action. You can select different match conditions, and actions from the drop-down list for the Select Alerts, and Action fields respectively. You can use combination of more than one policy rule. Select Add item to add more policy rules.

  • Select Configure link in Policy Rules box

  • Select + Add Item button.

  • Select Alerts drop-down menu option, Any option is default.

  • Select Action drop-down menu option, Send is default.

  • Select Add item button.

  • Order rules by dragging in Policy Rules page.

  • Select Apply button, order rules by dragging.

Step 6: Complete creating policy.

Select Save and Exit to complete creating the alert policy.


Create Alert Policy Set

Step 1: Start creating the alert policy set.
  • Open Audit Logs & Alerts.

Note: Active Alert Policies can be created and edited in Cloud and Edge Sites, Load Balancers, Web App & API Protection, and Distributed Apps services by selecting Manage > Alerts Management > + Select Active Alert Policies.

  • Select Alerts Management > Active Alert Policies.

  • + Select Active Alert Policies.

ACTIVEALERTPOLICIES10 2
Figure: Alert Policy Set Configuration

Step 2: Add alert policies to the policy set.
  • + Select Alert Policy button in Active Alert Policies pop-up window to activate the policy selection boxes.

ACTIVEALERTPOLICIES4 2
Figure: Alert Policy Set Configuration

  • Select boxes of created alert policy needed for policy set.

  • Select Alert Policy button to add the policies to the policy set.

ACTIVEALERTPOLICIES4 4
Figure: Alert Policy Set Configuration

Step 3: Complete creating the policy set.

Select Save and Exit button to complete creating the alert policy set.


Verification and Example

You can now verify the alert notifications by visiting your Slack channel. The following image shows a sample of alerts sent to Slack channel:

slack alerts
Figure: Post of Alerts to Slack Channel


Concepts