Skip to content

Commit

Permalink
Add configuration and check examples
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly authored Sep 19, 2019
1 parent d42a405 commit f830f1a
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ go build -o /usr/local/bin/sensu-alerta-handler main.go

Example Sensu Go handler definition:

**alerta-handler.json**

```json
{
"api_version": "core/v2",
Expand All @@ -27,7 +29,44 @@ Example Sensu Go handler definition:
"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"
]
}
}
```
Expand Down

0 comments on commit f830f1a

Please sign in to comment.