# Sensu Go Telegram Handler Plugin

The Sensu Go Telegram Handler is a [Sensu Event Handler][2] for sending
incident notification messages in Telegram.

## Installation

Download the latest version of the sensu-telegram-handler from [releases][1],
or create an executable script from this source.

From the local path of the sensu-telegram-handler repository:

```
go get git.paulbsd.com/paulbsd/sensu-telegram-handler
go build -o /usr/local/bin/sensu-telegram-handler git.paulbsd.com/paulbsd/sensu-telegram-handler/cmd/sensu-telegram-handler
```

## Configuration

Example Sensu Go definition:

```json
{
    "api_version": "core/v2",
    "type": "Handler",
    "metadata": {
        "namespace": "default",
        "name": "telegram"
    },
    "spec": {
        "type": "pipe",
        "command": "sensu-telegram-handler -t 123456789:dahxaemuGoM8ekeed1pideeCoh3ahm-abcd -c 9876543210",
        "timeout": 10,
        "filters": [
            "is_incident",
            "not_silenced"
        ]
    }
}
```

## Usage Examples

Help:

```
The Sensu Go Telegram handler for sending an telegram notification

Usage:
  sensu-telegram-handler [flags]

Flags:
  -T, --bodyTemplateFile string   A template file to use for the body
  -c, --channel int               The channel (default -1)
  -h, --help                      help for sensu-telegram-handler
  -H, --hookout                   Include output from check hook(s)
  -t, --token string              the telegram bot token
```

## Contributing

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

[1]: https://git.paulbsd.com/paulbsd/sensu-telegram-handler/releases (code base)
[2]: https://docs.sensu.io/sensu-go/5.0/reference/handlers/#how-do-sensu-handlers-work
