Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name

v0.2.0 · public · Published over 3 years ago

Asset Definition
Release Notes
Release Assets

Bonsai Asset Badge
Go Test

Sensu Chef Handler


The Sensu Chef Handler is a Sensu Event Handler that will
delete an entity with a failing keepalive check when its corresponding Chef
node no longer exists.

Usage examples


  sensu-chef-handler [flags]
  sensu-chef-handler [command]

Available Commands:
  help        Help about any command
  version     Print the version number of this plugin

  -k, --client-key-path string   The path to the Chef Client key to use when authenticating/querying the Chef Server API
  -c, --client-name string       The Chef Client name to use when authenticating/querying the Chef Server API
  -e, --endpoint string          The Chef Server API endpoint (URL)
  -f, --flavor string            The Chef Server flavor (enterprise or open_source)
  -h, --help                     help for sensu-chef-handler
      --node-name string         The Chef node name to use for the entity when querying Chef
      --sensu-api-key string     The Sensu API key
      --sensu-api-url string     The Sensu API URL (default "http://localhost:8080")
      --sensu-ca-cert string     The Sensu Go CA Certificate
  -p, --ssl-pem-path string      The Chef SSL pem file use when querying the Chef Server API
  -s, --ssl-verify               If the SSL certificate will be verified when querying the Chef Server API (default true)


Asset registration

Assets are the best way to make use of this handler. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:

sensuctl asset add sensu/sensu-chef-handler

If you're using an earlier version of sensuctl, you can download the asset
definition from this project's Bonsai Asset Index

Handler definition

Create the handler using the following handler definition:

api_version: core/v2
type: Handler
  namespace: default
  name: sensu-chef-handler
  type: pipe
  command: sensu-chef-handler
  timeout: 10
  - CHEF_CLIENT_NAME=your-chef-client
  - CHEF_CLIENT_KEY_PATH=/path/to/chef/client.pem
  - SENSU_API_URL=https://sensu-backend-url:8080
  - SENSU_API_KEY=sensu-api-key-here
  - is_incident
  - sensu/sensu-chef-handler

and then add the handler to the keepalive handler set:

api_version: core/v2
type: Handler
  name: keepalive
  namespace: default
  - sensu-chef-handler
  type: set

Check definition

No check definition is needed. This handler will only trigger on keepalive
events after it is added to the keepalive handler set.

Chef node name

When querying Chef for a node, by default, Sensu will use the Sensu entity’s
name for the Chef node name. Individual Sensu entities can override the name of
their corresponding Chef node, using annotations:

# /etc/sensu/agent.yml example

Installing from source and contributing

Download the latest version of the sensu-chef-handler from releases,
or create an executable script from this source.


From the local path of the sensu-chef-handler repository:

go build -o /usr/local/bin/ .

To contribute to this plugin, see CONTRIBUTING

Are you sure you want to report this asset?

Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.


You must be signed in to report this asset.

Sign In with Github



Either download the source code:

Download Source

Or download the asset definition: