Install plugins with assets

Assets are shareable, reusable packages that make it easier to deploy Sensu plugins. You can use assets to provide the plugins, libraries, and runtimes you need to automate your monitoring workflows. See the asset reference for more information about assets. This guide uses the Sensu PagerDuty Handler asset as an example.

NOTE: Assets are not required to use Sensu Go. You can install Sensu plugins using the sensu-install tool or a configuration management solution.

Register the Sensu PagerDuty Handler asset

To add the Sensu PagerDuty Handler asset to Sensu, use sensuctl asset add:

sensuctl asset add sensu/sensu-pagerduty-handler:1.2.0 -r pagerduty-handler

This example uses the -r (rename) flag to specify a shorter name for the asset: pagerduty-handler.

You can also click the Download button on the asset page in Bonsai to download the asset definition for your Sensu backend platform and architecture.

NOTE: Sensu does not download and install asset builds onto the system until they are needed for command execution. Read the asset reference for more information about asset builds.

Adjust the asset definition

Asset definitions tell Sensu how to download and verify the asset when required by a check, filter, mutator, or handler.

After you add or download the asset definition, open the file and adjust the namespace and filters for your Sensu instance. Here’s the asset definition for version 1.2.0 of the Sensu PagerDuty Handler asset for Linux AMD64:

type: Asset
api_version: core/v2
  name: pagerduty-handler
  namespace: default
  labels: {}
  annotations: {}
  sha512: 5be236b5b9ccceb10920d3a171ada4ac4f4caaf87f822475cd48bd7f2fab3235fa298f79ef6f97b0eb6498205740bb1af1120ca036fd3381edfebd9fb15aaa99
  - entity.system.os == 'linux'
  - entity.system.arch == 'amd64'

Filters for check assets should match entity platforms. Filters for handler and filter assets should match your Sensu backend platform. If the provided filters are too restrictive for your platform, replace os and arch with any supported entity system attributes (for example, entity.system.platform_family == 'rhel'). You may also want to customize the asset name to reflect the supported platform (for example, pagerduty-handler-linux) and add custom attributes with labels and annotations.

Enterprise-tier assets (like the ServiceNow and Jira event handlers) require a Sensu commercial license. For more information about commercial features and to activate your license, see Get started with commercial features.

Use sensuctl to verify that the asset is registered and ready to use:

sensuctl asset list --format yaml

Create a workflow

With the asset downloaded and registered, you can use it in a monitoring workflow. Assets may provide executable plugins intended for use with a Sensu check, handler, mutator, or hook, or JavaScript libraries intended to provide functionality for use in event filters. The details in Bonsai are the best resource for information about each asset’s capabilities and configuration.

For example, to use the Sensu PagerDuty Handler asset, you would create a pagerduty handler that includes your PagerDuty service API key in place of SECRET and pagerduty-handler as a runtime asset:

type: Handler
api_version: core/v2
  name: pagerduty
  namespace: default
  command: sensu-pagerduty-handler
  - is_incident
  - pagerduty-handler
  timeout: 10
  type: pipe
    "api_version": "core/v2",
    "type": "Handler",
    "metadata": {
        "namespace": "default",
        "name": "pagerduty"
    "spec": {
        "type": "pipe",
        "command": "sensu-pagerduty-handler",
        "env_vars": [
        "runtime_assets": ["pagerduty-handler"],
        "timeout": 10,
        "filters": [

Save the definition to a file (for example, pagerduty-handler.json), and add it to Sensu with sensuctl:

sensuctl create --file pagerduty-handler.json

Now that Sensu can create incidents in PagerDuty, you can automate this workflow by adding the pagerduty handler to your Sensu service check definitions. See Monitor server resources to learn more.

Next steps

Read these resources for more information about using assets in Sensu:

You can also try our interactive tutorial to send critical alerts to your PagerDuty account.