Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


master · public · Published over 5 years ago

README
Asset Definition
Release Notes
Release Assets

Sensu Serverspec Event Handler

TravisCI: TravisCI Build Status

The Sensu Serverspec Event Handler is a Sensu Event Handler that parses
Serverspec JSON output and creates new Sensu events for each test.

Installation

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

From the local path of the sensu-serverspec-events repository:

go build -o /usr/local/bin/sensu-serverspec-events main.go

Configuration

Example Sensu Go handler definition:

type: Handler
api_version: core/v2
metadata:
  name: serverspec-events
  namespace: default
spec:
  command: sensu-serverspec-events -n serverspec --handlers pagerduty
  env_vars:
  - SENSU_API_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NjUzMTE4NjYsImp0aSI6ImViYWM5OTk0NTI5MzYyNzIwMjc2NTY3NzU5OGZmZjdkIiwic3ViIjoiYWRtaW4iLCJncm91cHMiOlsiY2x1c3Rlci1hZG1pbnMiLCJzeXN0ZW06dXNlcnMiXSwicHJvdmlkZXIiOnsicHJvdmlkZXJfaWQiOiJiYXNpYyIsInVzZXJfaWQiOiJhZG1pbiJ9fQ.VE9c6CGYZTRR9e6fyez75n8EHgHn94z_Sk-h6iqZ8jQ
  type: pipe

Example Sensu Go check definition:

type: CheckConfig
api_version: core/v2
metadata:
  name: serverspec-run
  namespace: default
spec:
  command: serverspec-run.sh SPEC_OPTS="--format json" | tail -n +3
  handlers:
  - serverspec-events
  interval: 60
  publish: true
  subscriptions:
  - test

Usage Examples

Help:

a serverspec json handler to use with sensu

Usage:
  sensu-serverspec-events [flags]

Flags:
      --handlers strings   sensu handlers that the new serverspec events will be handled by
  -h, --help               help for sensu-serverspec-events
  -n, --namespace string   sensu namespace that the new serverspec events will be created in (default "default")
  -t, --token string       sensu api token, (default is the value of the SENSU_API_TOKEN environment variable)
  -u, --url string         sensu api url (default "http://127.0.0.1:8080")

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

×

There are no asset definitions for this version, only source code:

Download Source Cancel