Documentation Index

Fetch the complete documentation index at: https://kb.vastdata.com/llms.txt

Use this file to discover all available pages before exploring further.

Managing Webhooks

Prev Next

Overview

Webhooks enable the VAST cluster to automatically send preconfigured HTTP requests to an external application endpoint when certain events are encountered on the cluster.

When you create a webhook, you specify the endpoint URL, which HTTP method to use, and which event details to include in the request. You can also specify custom HTTP headers to be included. If you want to secure the connection to the external application with TLS, add the TLS certificate and key for the webhook.

Each webhook can be enabled or disabled as needed.

After a webhook is created, you attach it to the event definition that represents the type of events on which the webhook is to be triggered. If you want, you can also configure the event definition so that the webhook is triggered not only for alarms, but also for informational events.

In addition to webhooks attached to event definitions, you can enable one webhook that is not associated with any specific event definition.

When an alarm is raised on a event that does not have a webhook attached to its event definition, VMS automatically triggers all enabled webhooks. For event definitions that have specific webhooks attached to them, only the attached webhooks are triggered.

Webhooks can be configured using VAST Web UI, VAST CLI or VAST REST API. For example, the following command uses VAST REST API to create a webhook named jira-helpdesk for an external application listening for POST requests at https://destination_url.example.com/vast-alerts. The request conveys the event name, severity, cluster name, object name, and event timestamp.

curl -X POST "https://<vms-host>/api/latest/webhooks/" \
  -H "Authorization: Api-Token <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "jira-helpdesk",
    "url": "https://destination_url.example.com/vast-alerts",
    "method": "POST",
    "headers": {
      "Content-Type": "application/json"
    },
    "data": "{\"text\": \"*VAST Alert: ${vastdata_event_name}*\n${event}\n
             Severity: ${vastdata_severity}\nCluster: ${vastdata_cluster_name}\n
             Object: ${vastdata_object_name}\nTime: ${vastdata_timestamp_iso_8601}\"}"

Creating Webhooks

  1. From the left navigation menu, select Alarms & Events and then Webhooks.

  2. Click Create Webhook.

  3. In the General tab, enter these details for the webhook:

    Field

    Description

    Webhook name

    The name of the webhook, as it will appear in the list in the Webhooks tab.

    Webhook Method

    Select the HTTP method to be used when the notification is sent to the external application.

    Webhook URL

    The URL of the external application.

  4. In the Webhook Data section, enter the data block to be sent as the webhook message to the external application, in JSON format. Alternatively, click Upload JSON to browse and upload a file with the JSON data block.

    Note

    The Events panel shows a list of variables, and their meanings, that can be included in the JSON data block, to indicate specific details for the event, such as the name, time, duration, etc.

  5. In the Certificate section, optionally select the certificate to be used, from the list.

    See Adding Certificates for Webhooks for details about adding new certificates.

  6. In the Custom HTTP Headers section, you can optionally add custom headers to HTTP messages sent to the webhook server. You can add as many custom headers as necessary. Enter the Header Name and Value, then click Add. Repeat for additional headers.

  7. Click Save. The new webhook appears in the list in the Webhooks tab.

  8. Right-click the webhook in the list, and click Activate to enable it.

To create a webhook in VAST CLI, use the webhook create command.

Variables in Webhook Data

Webhook data can include the following variables:

Variable

Description

${vastdata_timestamp}

The date and time of the event.

${vastdata_timestamp_unix}

A UNIX-style timestamp of the event (Unix epoch seconds, for example: 1786712460).

${vastdata_timestamp_iso_8601}

The event timestamp in ISO-8601 format (YYYY-MM-DDTHH:mm:ssZ, for example: 2025-01-17T18:12:06+0000).

${vastdata_object_type}

The type of object being monitored for the event type (the entire cluster, a hardware component such as a NIC, or a logical entity such as a view).

${vastdata_object_id}

The ID of the object involved in the event.

${vastdata_object_name}

The name of the object involved in the event.

${vastdata_event_type}

The type of change in the property value that triggered the event (object modified, threshold reached, rate exceeded).

${vastdata_event_name}

The name of the event.

${vastdata_property}

The property involved in the event.

${vastdata_event_origin}

Indicates where the event originates: the cluster (for example, a failed CNode), user (user action), security (such as login, logout, failed login), or management.

${vastdata_cluster_name}

The name of the cluster on which the event occurred.

${vastdata_severity}

Event severity: critical, major, minor or N/A (no raised alarm).

${vastdata_mapped_severity}

The configured custom name for the event severity level.

For example, the following JSON data block:

{
  "event_name": "$vastdata_event_name",
  "object_name": "$vastdata_object_name",
  "event_type": "$vastdata_event_type"
}

results in this, when the variables are substituted with actual event information:

{
  "event_name": "VIEW_CREATE", 
  "object_name": "/c", 
  "event_type": "OBJECT_CREATED"
}

Adding Certificates for Webhooks

You can add certificates and keys to be used to secure the connection to the external application.

The certificates and keys must be in RSA or ECDSA format.

To add a webhook certificate in VAST Web UI:

  1. Navigate to the webhook, right-click it, and select Edit.

  2. In the Certificates tab, click Add New for the following items, as necessary:

    Certificate

    Paste the certificate.

    Key

    Paste the private key to be used for communication with the webhook client.

    CA Certificate

    Paste the certificate for the CA authority that signed the certificate.

  3. Save your changes.

To add a webhook certificate in VAST CLI:

  1. Upload the certificate to the VMS using the certificate create command with the --cert-type WEBHOOK option specified.

  2. Obtain the ID of the uploaded certificate by running the certificate list command.

  3. Run the webhook create or webhook modify command with the --certificate-id option specified.

Attaching Webhooks to Event Definitions

To attach a webhook to an event definition in VAST Web UI:

  1. Navigate to Alarms & Events -> Event Definitions, right-click the event definition to which you want to attach a webhook. and choose Edit.

  2. In the Action tab of the Event Definition dialog, select the webhook in the Select webhook field.

To attach a webhook to an event definition in VAST CLI:

  1. Run webhook list to obtain the ID of the webhook you want to attach.

  2. Run eventdefinition modify with the webhook ID specified on the --webhooks option.

Alarm-Only Webhooks

You can configure the event definition so that its webhook(s) is triggered for any events represented by the event definition, or only for events for which the VMS raises an alarm. By default, a webhook is triggered only for alarm-raising events.

If you want to trigger the webhook for both alarm-raising and informational events:

  • In VAST Web UI, toggle off the Alarm only option in event definition settings (Alarms & Events -> Event Definitions -> choose to edit an event definition).

  • In VAST CLI, run the eventdefinition modify command with the --disable-alarm-only option specified.

NOTE: This action will also disable the option for all other notification types configured for the event definition.

For example, if the you have an event definition that looks for changes in the CNode state:

  • If Alarm only is on (default), the webhook is triggered for alarming changes only (e.g. from UP to DOWN only).

  • If Alarm only is off, the webhook is triggered for every state change (e.g. from UP to DOWN and from DOWN to UP).

Enabling or Disabling Webhooks

To enable or disable a webhook in VAST Web UI:

  • From the left navigation menu, select Alarms & Events and then Webhooks . A list of all the webhooks that have been defined is shown. Right-click a webhook and select Activate to enable it, or Deactivate to disable it.

    NOTE: You cannot disable a webhook that is associated with one or more event definitions.

To enable or disable a webhook in VAST CLI, use the --enable or --disable options on the webhook create or webhook modify command.

Modifying or Deleting Webhooks

To modify or delete a webhook in VAST Web UI:

  1. From the left navigation menu, select Alarms & Events and then Webhooks.

  2. Right-click the webhook to modify or delete, then select Edit to modify it, or Delete to delete it. If you are editing the webhook, make the necessary changes and then click Save.

    Note

    You cannot delete a webhook that is associated with event definitions.

To modify a webhook in VAST CLI, use the webhook modify command.

Listing Webhooks

To list webhooks in VAST Web UI:

  • From the left navigation menu, select Alarms & Events and then Webhooks. A list of all the webhooks that have been defined is shown. Right-click a webhook to open a menu with actions to view details for the webhook, modify it, remove it, enable it, or disable it.

To list webhooks in VAST CLI, use the webhook list command. To view details of a particular webhook, use the webhook show command.