Skip to content

johntdyer/sensu-webex-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1924ca5 · Nov 20, 2019

History

18 Commits
Jan 2, 2019
Jan 3, 2019
Jan 2, 2019
Jan 2, 2019
Nov 20, 2019
Nov 20, 2019
Nov 20, 2019
May 21, 2019
Nov 20, 2019
Jan 2, 2019
Jan 2, 2019
Jan 2, 2019
Jan 2, 2019
Jan 2, 2019
Jan 2, 2019

Repository files navigation

Sensu Go webex Handler

The Sensu webex handler is a Sensu Event Handler that sends event data to a configured webex channel. This plugin was mostly copied from the Sensu slack handler and repurposed for Webex Teams.

screenshot

Installation

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

From the local path of the webex-handler repository:

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

Configuration

Example Sensu Go handler definition:

webex-handler.json

{
    "api_version": "core/v2",
    "type": "Handler",
    "metadata": {
        "namespace": "default",
        "name": "webex"
    },
    "spec": {
        "type": "pipe",
        "command": "sensu-webex-handler --token abc123 --room-id 'ABCDEFGHIJKLMNOP123' --timeout 20 \\",
        "timeout": 30,
        "filters": [
            "is_incident"
        ]
    }
}

sensuctl create -f webex-handler.json

Example Sensu Go check definition:

{
    "api_version": "core/v2",
    "type": "CheckConfig",
    "metadata": {
        "namespace": "default",
        "name": "dummy-app-healthz"
    },
    "spec": {
        "command": "check-http -u http://localhost:8080/healthz",
        "subscriptions":[
            "dummy"
        ],
        "publish": true,
        "interval": 10,
        "handlers": [
            "webex"
        ]
    }
}

Usage examples

Help:

The Sensu Go webex handler for notifying a channel

Usage:
  sensu-webex-handler [flags]

Flags:
  -c, --room-id string       The space to post messages to, can also be a users email if you want to send directly to a person vs a space
  -t, --token string         Api token to use
  -h, --help                 help for handler-webex
  -t, --timeout int          The amount of seconds to wait before terminating the handler (default 10)