Documentation
¶
Overview ¶
Package notifier manages notifications for consul-alerts
Package notifier manages notifications for consul-alerts
Index ¶
- Constants
- func MakeBody(messages Messages) string
- func MakeSubject(messages Messages) string
- type AwsSnsNotifier
- type EmailData
- type EmailNotifier
- type HipChatNotifier
- type InfluxdbNotifier
- type LogNotifier
- type Message
- type Messages
- type Notifier
- type OpsGenieNotifier
- type PagerDutyNotifier
- type SlackNotifier
- type VictorOpsEvent
- type VictorOpsNotifier
Constants ¶
const ( SYSTEM_HEALTHY string = "HEALTHY" SYSTEM_UNSTABLE string = "UNSTABLE" SYSTEM_CRITICAL string = "CRITICAL" )
Variables ¶
This section is empty.
Functions ¶
func MakeSubject ¶ added in v0.4.0
Types ¶
type AwsSnsNotifier ¶ added in v0.4.0
func (*AwsSnsNotifier) NotifierName ¶ added in v0.4.0
func (awssns *AwsSnsNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*AwsSnsNotifier) Notify ¶ added in v0.4.0
func (awssns *AwsSnsNotifier) Notify(messages Messages) bool
type EmailData ¶
type EmailData struct {
ClusterName string
SystemStatus string
FailCount int
WarnCount int
PassCount int
Nodes map[string]Messages
}
func (EmailData) IsCritical ¶
type EmailNotifier ¶
type EmailNotifier struct {
ClusterName string
Template string
Url string
Port int
Username string
Password string
SenderAlias string
SenderEmail string
Receivers []string
NotifName string
OnePerAlert bool
OnePerNode bool
}
func (*EmailNotifier) NotifierName ¶ added in v0.4.0
func (emailNotifier *EmailNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*EmailNotifier) Notify ¶
func (emailNotifier *EmailNotifier) Notify(alerts Messages) bool
Notify sends messages to the endpoint notifier
type HipChatNotifier ¶ added in v0.3.1
type HipChatNotifier struct {
ClusterName string
RoomId string
AuthToken string
BaseURL string
From string
NotifName string
}
func (*HipChatNotifier) NotifierName ¶ added in v0.4.0
func (notifier *HipChatNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*HipChatNotifier) Notify ¶ added in v0.3.1
func (notifier *HipChatNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier
type InfluxdbNotifier ¶
type InfluxdbNotifier struct {
Host string
Username string
Password string
Database string
SeriesName string
NotifName string
}
func (*InfluxdbNotifier) NotifierName ¶ added in v0.4.0
func (influxdb *InfluxdbNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*InfluxdbNotifier) Notify ¶
func (influxdb *InfluxdbNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier
type LogNotifier ¶
func (*LogNotifier) NotifierName ¶ added in v0.4.0
func (logNotifier *LogNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*LogNotifier) Notify ¶
func (logNotifier *LogNotifier) Notify(alerts Messages) bool
Notify sends messages to the endpoint notifier
type Message ¶
type Message struct {
Node string
ServiceId string
Service string
CheckId string
Check string
Status string
Output string
Notes string
Interval int
RmdCheck time.Time
NotifList map[string]bool
Timestamp time.Time
}
func (Message) IsCritical ¶
type OpsGenieNotifier ¶ added in v0.3.3
func (*OpsGenieNotifier) NotifierName ¶ added in v0.4.0
func (opsgenie *OpsGenieNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*OpsGenieNotifier) Notify ¶ added in v0.3.3
func (opsgenie *OpsGenieNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier
type PagerDutyNotifier ¶ added in v0.1.2
type PagerDutyNotifier struct {
ServiceKey string
ClientName string
ClientUrl string
NotifName string
}
func (*PagerDutyNotifier) NotifierName ¶ added in v0.4.0
func (pd *PagerDutyNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*PagerDutyNotifier) Notify ¶ added in v0.1.2
func (pd *PagerDutyNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier
type SlackNotifier ¶
type SlackNotifier struct {
ClusterName string `json:"-"`
Url string `json:"-"`
Channel string `json:"channel"`
Username string `json:"username"`
IconUrl string `json:"icon_url"`
IconEmoji string `json:"icon_emoji"`
Text string `json:"text,omitempty"`
Attachments []attachment `json:"attachments,omitempty"`
Detailed bool `json:"-"`
NotifName string
}
func (*SlackNotifier) NotifierName ¶ added in v0.4.0
func (slack *SlackNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*SlackNotifier) Notify ¶
func (slack *SlackNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier
type VictorOpsEvent ¶ added in v0.4.0
type VictorOpsEvent struct {
// Explicitly listed by http://victorops.force.com/knowledgebase/articles/Integration/Alert-Ingestion-API-Documentation/
MessageType string `json:"message_type"`
EntityID string `json:"entity_id"`
Timestamp uint32 `json:"timestamp"`
StateMessage string `json:"state_message"`
MonitoringTool string `json:"monitoring_tool"`
EntityDisplayName string `json:"entity_display_name"`
// Helpful fields from http://victorops.force.com/knowledgebase/articles/Getting_Started/Incident-Fields-Glossary/?l=en_US&fs=RelatedArticle
HostName string `json:"host_name"`
MonitorName string `json:"monitor_name"`
// VictorOps lets you add arbitrary fields to help custom notification logic, so we'll set
// node, service, service ID, check, and check ID
ConsulNode string `json:"consul_node"`
ConsulService string `json:"consul_service,omitempty"`
ConsulServiceID string `json:"consul_service_id,omitempty"`
ConsulCheck string `json:"consul_check"`
ConsulCheckID string `json:"consul_check_id"`
}
VictorOpsEvent represents the options we'll pass to the VictorOps API
type VictorOpsNotifier ¶ added in v0.4.0
VictorOpsNotifier provides configuration options for the VictorOps notifier
func (*VictorOpsNotifier) NotifierName ¶ added in v0.4.0
func (vo *VictorOpsNotifier) NotifierName() string
NotifierName provides name for notifier selection
func (*VictorOpsNotifier) Notify ¶ added in v0.4.0
func (vo *VictorOpsNotifier) Notify(messages Messages) bool
Notify sends messages to the endpoint notifier