Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alerta/sensu-alerta-handler
Use Alerta as a dashboard for Sensu
https://github.com/alerta/sensu-alerta-handler
alerta golang sensu sensu-go sensu-handler
Last synced: about 1 month ago
JSON representation
Use Alerta as a dashboard for Sensu
- Host: GitHub
- URL: https://github.com/alerta/sensu-alerta-handler
- Owner: alerta
- License: mit
- Created: 2014-02-26T20:01:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-11-09T21:47:10.000Z (about 3 years ago)
- Last Synced: 2024-05-21T04:15:39.251Z (7 months ago)
- Topics: alerta, golang, sensu, sensu-go, sensu-handler
- Language: Go
- Homepage: http://alerta.io
- Size: 1.27 MB
- Stars: 20
- Watchers: 6
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Sensu Go Alerta Handler
[![Bonsai Asset Badge](https://img.shields.io/badge/Bonsai-Download%20Me-brightgreen.svg?colorB=89C967&logo=sensu)](https://bonsai.sensu.io/assets/alerta/sensu-alerta-handler) [![build-test](https://github.com/alerta/sensu-alerta-handler/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/alerta/sensu-alerta-handler/actions/workflows/test.yml)
Forward Sensu events to Alerta.
## Installation
Download the latest version of the sensu-alerta-handler from [releases][1],
or create an executable script from this source.From the local path of the sensu-alerta-handler repository:
```
go build -o /usr/local/bin/sensu-alerta-handler main.go
```## Configuration
Example Sensu Go handler definition:
**alerta-handler.json**
```json
{
"api_version": "core/v2",
"type": "Handler",
"metadata": {
"namespace": "default",
"name": "alerta"
},
"spec": {
"type": "pipe",
"command": "sensu-alerta-handler --endpoint-url https://alerta.example.com/api",
"env_vars": [
"ALERTA_API_KEY=G25k9JR2yoZIcHROQGS477nk_Riw4CIghFC6j9NE"
],"timeout": 30,
"filters": [
"is_incident"
]
}
}
```Create the handler resource:
$ sensuctl create -f alerta-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": [
"alerta"
]
}
}
```## Usage Examples
Help:
```
The Sensu Go Alerta handler for event forwardingUsage:
sensu-alerta-handler [flags]Flags:
-K, --api-key string API key for authenticated access
--endpoint-url string API endpoint URL (default "http://localhost:8080")
-E, --environment string Environment eg. Production, Development (default "Entity Namespace")
-h, --help help for sensu-alerta-handler
```## Contributing
See https://github.com/sensu/sensu-go/blob/master/CONTRIBUTING.md
[1]: https://github.com/alerta/sensu-alerta-handler/releases