diff --git a/kapacitor.go b/kapacitor.go index 74f895d91..019a884ee 100644 --- a/kapacitor.go +++ b/kapacitor.go @@ -26,6 +26,7 @@ type AlertNodes struct { ServiceNow []*ServiceNow `json:"serviceNow"` // ServiceNow alert options BigPanda []*BigPanda `json:"bigPanda"` // BigPanda alert options Teams []*Teams `json:"teams"` // Teams alert options + Zenoss []*Zenoss `json:"zenoss"` // Zenoss alert options } // Post will POST alerts to a destination URL @@ -162,6 +163,19 @@ type Teams struct { ChannelURL string `json:"channel-url"` // override configuration } +// Teams properties +type Zenoss struct { + Action string `json:"action"` + Method string `json:"method"` + Type string `json:"type"` + TID int64 `json:"tid"` + + Device string `json:"device"` + Component string `json:"component"` + EventClassKey string `json:"evclasskey"` + EventClass string `json:"evclass"` +} + // MarshalJSON converts AlertNodes to JSON func (n *AlertNodes) MarshalJSON() ([]byte, error) { type Alias AlertNodes diff --git a/kapacitor/alerts_test.go b/kapacitor/alerts_test.go index eb90df3c8..f84c79d14 100644 --- a/kapacitor/alerts_test.go +++ b/kapacitor/alerts_test.go @@ -207,6 +207,34 @@ func TestAlertServices(t *testing.T) { want: `alert() .teams() .channelURL('https://outlook.office.com/webhook/...') +`, + }, + { + name: "Test Zenoss", + rule: chronograf.AlertRule{ + AlertNodes: chronograf.AlertNodes{ + Zenoss: []*chronograf.Zenoss{{ + Action: "a", + Method: "b", + Type: "c", + TID: 4, + Device: "e", + Component: "f", + EventClassKey: "g", + EventClass: "h", + }}, + }, + }, + want: `alert() + .zenoss() + .action('a') + .method('b') + .type('c') + .TID(4) + .device('e') + .component('f') + .eventClassKey('g') + .eventClass('h') `, }, }