Skip to content

Commit

Permalink
test: add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
alespour committed Mar 24, 2021
1 parent 7b68f2c commit 152cb0d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pipeline/tick/alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,3 +790,29 @@ func TestAlertSNMP(t *testing.T) {
`
PipelineTickTestHelper(t, pipe, want)
}

func TestAlertZenoss(t *testing.T) {
pipe, _, from := StreamFrom()
handler := from.Alert().Zenoss()
handler.Action = "custom_add_event"
handler.Summary = "server alert"
handler.Device = "server-A"
handler.Component = "CPU"
handler.EventClass = "/App"

want := `stream
|from()
|alert()
.id('{{ .Name }}:{{ .Group }}')
.message('{{ .ID }} is {{ .Level }}')
.details('{{ json . }}')
.history(21)
.zenoss()
.action('custom_add_event')
.summary('server alert')
.device('server-A')
.component('CPU')
.eventClass('/App')
`
PipelineTickTestHelper(t, pipe, want)
}

0 comments on commit 152cb0d

Please sign in to comment.