Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.0.4 · public · Published almost 4 years ago

README
Asset Definition
Release Notes
Release Assets

Sensu Bonsai Asset
Go Test
goreleaser

Sensu Runbook

Table of Contents

Overview

Execute commands and custom scripts on Sensu Agent nodes. Sensu Go offers several unique attributes that make it a compelling runbook automation platform, including:

  • Namespaces & RBAC. Sensu Go is a multi-tenant platform, with SSO and API
    Keys, enabling self-service runbook automation
  • Secure transport. Sensu offers TLS certificate-based auth & TLS encrypted
    transport
  • Publish/subscribe model of communication. No centralized system with "keys to
    the kingdom" to remotely access target nodes and execute arbitrary commands
  • Sensu Assets. Use Sensu to securely automate distribution of custom
    runbook code (e.g. shell scripts or python scripts)
  • Sensu Tokens. Use Sensu's powerful templating system to create dynamic
    runbook automations that can scale to thousands of nodes
  • Event processing. Integrate with Slack, Pagerduty, ServiceNow, VictorOps,
    JIRA, and more
  • Code reuse. Reuse ad hoc runbook scripts as monitoring checks or automated
    remediations using Sensu Go
  • Audit logging. The runbook configuration, request, execution, and event
    processing are all logged by Sensu
  • Much, much, more...

Usage examples

  • Run as a standalone program:

    $ ./sensu-runbook --help
    Sensu Runbook Automation. Execute commands on Sensu Agent nodes.
    
    Usage:
      sensu-runbook [flags]
      sensu-runbook [command]
    
    Available Commands:
      help        Help about any command
      version     Print the version number of this plugin
    
    Flags:
      -c, --command string                 The command that should be executed by the Sensu Go agent(s)
      -h, --help                           help for sensu-runbook
      -i, --id string                      The ID or name to use for the job (i.e. defaults to a random UUIDv4)
      -n, --namespace string               Sensu Namespace to perform the runbook automation (defaults to $SENSU_NAMESPACE)
      -a, --runtime-assets string          Comma-separated list of assets to distribute with the command(s)
          --sensu-access-token string      Sensu API Access Token (defaults to $SENSU_ACCESS_TOKEN) 
          --sensu-api-url string           Sensu API URL (defaults to $SENSU_API_URL)
          --sensu-trusted-ca-file string   Sensu API Trusted Certificate Authority File (defaults to $SENSU_TRUSTED_CA_FILE)
      -s, --subscriptions string           Comma-separated list of subscriptions to execute the command(s) on
      -t, --timeout string                 Command execution timeout, in seconds (default "10")
    
    Use "sensu-runbook [command] --help" for more information about a command.
    
  • Use as a sensuctl command plugin:

    $ sensuctl command install runbook calebhailey/sensu-runbook
    command was installed successfully
    $ sensuctl command exec runbook -- --help 
    INFO[0000] asset includes builds, using builds instead of asset  asset=runbook component=asset-manager entity=sensuctl
    Sensu Runbook Automation. Execute commands on Sensu Agent nodes.
    
    Usage:
      sensu-runbook [flags]
      sensu-runbook [command]
    
    Available Commands:
      help        Help about any command
      version     Print the version number of this plugin
    
    Flags:
      -c, --command string                 The command that should be executed by the Sensu Go agent(s)
      -h, --help                           help for sensu-runbook
      -i, --id string                      The ID or name to use for the job (i.e. defaults to a random UUIDv4)
      -n, --namespace string               Sensu Namespace to perform the runbook automation (defaults to $SENSU_NAMESPACE)
      -a, --runtime-assets string          Comma-separated list of assets to distribute with the command(s)
          --sensu-access-token string      Sensu API Access Token (defaults to $SENSU_ACCESS_TOKEN) 
          --sensu-api-url string           Sensu API URL (defaults to $SENSU_API_URL)
          --sensu-trusted-ca-file string   Sensu API Trusted Certificate Authority File (defaults to $SENSU_TRUSTED_CA_FILE)
      -s, --subscriptions string           Comma-separated list of subscriptions to execute the command(s) on
      -t, --timeout string                 Command execution timeout, in seconds (default "10")
    
    Use "sensu-runbook [command] --help" for more information about a command.
    

Configuration

Sensuctl command installation

This plugin is intended for use as a [sensuctl command plugin][command]. If
you're using sensuctl 5.13 or later, run the following command:

sensuctl command install calebhailey/sensu-runbook

Installation from source

The preferred way of installing and deploying this plugin is to use it as an Asset. If you would
like to compile and install the plugin from source or contribute to it, download the latest version
or create an executable script from this source.

From the local path of the sensu-runbook repository:

go build

Additional notes

This plugin is in technical preview and should be considered "unstable", but
feedback is welcome and appreciated!

Roadmap

  • [x] Publish asset to Bonsai
  • [x] Add support for --runtime_assets
  • [ ] Add support for --handlers
  • [ ] Add support for private assets (--url and --sha512)
  • [ ] Generate a link to view the results in the dashboard
  • [ ] Automatically show results after job execution!
  • [ ] Write a blog post!

Contributing

For more information about contributing 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: