From 152cb0d16c078f743995dd1357dcf24b16ff51b8 Mon Sep 17 00:00:00 2001 From: Ales Pour Date: Wed, 24 Mar 2021 13:22:02 +0100 Subject: [PATCH] test: add missing test --- pipeline/tick/alert_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pipeline/tick/alert_test.go b/pipeline/tick/alert_test.go index b37901312..1802fde0f 100644 --- a/pipeline/tick/alert_test.go +++ b/pipeline/tick/alert_test.go @@ -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) +}