Skip to content

Commit

Permalink
Merge pull request #59 from sensu/sensu-pagerduty-json-error
Browse files Browse the repository at this point in the history
Sensu pagerduty json error
  • Loading branch information
chavakula authored Aug 1, 2024
2 parents f116eaa + f107bd1 commit 8a873c4
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ If you're using an earlier version of sensuctl, you can find the asset on the
[Bonsai Asset Index][7].

### Handler definition

When `--details-format` is set to `string` the `--details-template` option can be any string.
```yml
---
type: Handler
Expand All @@ -150,6 +150,33 @@ spec:
secret: pagerduty_authtoken
```
When `--details-format` is set to `json` the `--details-template` option needs to contain a valid JSON document.
```yml
---
type: Handler
api_version: core/v2
metadata:
name: pagerduty
namespace: default
spec:
type: pipe
command: >-
sensu-pagerduty-handler
--dedup-key-template "{{.Entity.Namespace}}-{{.Entity.Name}}-{{.Check.Name}}"
--status-map "{\"info\":[0],\"warning\": [1],\"critical\": [2],\"error\": [3,127]}"
--summary-template "[{{.Entity.Namespace}}] {{.Entity.Name}}/{{.Check.Name}}: {{.Check.State}}"
--details-template '{"output":"{{.Check.Output}}","check":"{{.Check.Name}}"}'
--details-format json
timeout: 10
runtime_assets:
- sensu/sensu-pagerduty-handler
filters:
- is_incident
secrets:
- name: PAGERDUTY_TOKEN
secret: pagerduty_authtoken
```

### Environment variables

Most arguments for this handler are available to be set via environment
Expand Down

0 comments on commit 8a873c4

Please sign in to comment.