Select Supported Platforms

Select Supported Architectures

Select Tier

Github Name


v0.0.4 · public · Published 7 months ago

README
Asset Definition
Release Notes
Release Assets

Sensu Go Hangouts Chat Handler

TravisCI: Build Status
Sensu Bonsai Asset

The Sensu Go Hangouts Chat Handler is a Sensu Event Handler which manages
Hangouts Chat for alerting purposes. With this handler,
Sensu can alert systems administrators in Hangouts Chats.

This handler was inspired by hangouts ruby plugin.

Installation

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

From the local path of the sensu-hangouts-chat-handler repository:

go build -o /usr/local/bin/sensu-hangouts-chat-handler main.go

Configuration

Example Sensu Go handler definition:

{
    "api_version": "core/v2",
    "type": "Handler",
    "metadata": {
        "namespace": "default",
        "name": "hangouts-chat"
    },
    "spec": {
        "type": "pipe",
        "command": "sensu-hangouts-chat-handler",
        "env_vars": [
          "WEBHOOK_HANGOUTSCHAT=https://...."
        ],
        "timeout": 10,
        "filters": [
            "is_incident"
        ]
    }
}

Example Sensu Go check definition:

{
    "api_version": "core/v2",
    "type": "CheckConfig",
    "metadata": {
        "namespace": "default",
        "name": "dummy-app-healthz",
        "annotations": {
            "documentation": "https://docs.sensu.io/sensu-go/latest"
        }
    },
    "spec": {
        "command": "check-http -u http://localhost:8080/healthz",
        "subscriptions":[
            "dummy"
        ],
        "publish": true,
        "interval": 10,
        "handlers": [
            "hangouts-chat"
        ]
    }
}

Usage Examples

Help:

Usage:
  sensu-hangouts-chat-handler [flags]

Flags:
  -w, --webhook string   The Webhook from Hangouts Chat, use default from WEBHOOK_HANGOUTSCHAT env var
  -h, --help             help for sensu-opsgenie-handler
  -a, --withAnnotations  To parse annotations metadata field to include in message to Hangouts Chat. Use HANGOUTSCHAT_ANNOTATIONS env var. Split them using comma (,).
  --sensuDashboard       Sensu Dashboard URL like: http://sensu-dashboard.example.local/c/~/n", use HANGOUTSCHAT_SENSU_DASHBOARD env var.

Note: Make sure to set the WEBHOOK_HANGOUTSCHAT environment variable for sensitive credentials in production to prevent leaking into system process table. Please remember command arguments can be viewed by unprivileged users using commands such as ps or top. The --webhook argument is provided as an override primarily for testing purposes.

To parse any annotation

With this new feature you can include any annotation metadata field to show inside Hangsout Chat message. By default they will look for documentation and playbook.

Asset creation

Example:

sensuctl asset create sensu-hangouts-chat-handler --url "https://assets.bonsai.sensu.io/1daec49623e9384d5374f7e11f12a343cf374e5f/sensu-hangouts-chat-handler_0.0.1_linux_amd64.tar.gz" --sha512 "59fd8fd9909819ad9eb1897814e38903634e6ed38cadc50a2ad75a069b466bc9b4eb23bc33ce51fc58bb8cff47b931256b0e2e8cfe60a89c4ebfafca097e8c45"

Contributing

See https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md

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: