Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.1.1 · public · Published about 4 years ago

README
Asset Definition
Release Notes
Release Assets

Bonsai Asset Badge
Go Test

Sensu Chef Handler

Overview

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

Help:

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

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

Flags:
  -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
      --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)

Configuration

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
page
.

Handler definition

Create the handler using the following handler definition:

---
api_version: core/v2
type: Handler
metadata:
  namespace: default
  name: sensu-chef-handler
spec:
  type: pipe
  command: sensu-chef-handler
  timeout: 10
  env_vars:
  - CHEF_ENDPOINT=https://api.chef.io/organizations/replace-me
  - 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
  filters:
  - is_incident
  runtime_assets:
  - sensu/sensu-chef-handler

and then add the handler to the keepalive handler set:

---
api_version: core/v2
type: Handler
metadata:
  name: keepalive
  namespace: default
spec:
  handlers:
  - 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.

Installing from source and contributing

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

Compiling

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

Download

×

Either download the source code:

Download Source

Or download the asset definition: