notifiers

package
v0.0.0-...-34a2968 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const AlertStateCritical = "CRITICAL"

AlertStateCritical - Victorops uses "CRITICAL" string to indicate "Alerting" state

View Source
const AlertStateWarning = "WARNING"

AlertStateWarning - VictorOps "WARNING" message type

Variables

This section is empty.

Functions

func NewAlertmanagerNotifier

func NewAlertmanagerNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewAlertmanagerNotifier returns a new Alertmanager notifier

func NewEmailNotifier

func NewEmailNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewEmailNotifier is the constructor function for the EmailNotifier.

func NewHipChatNotifier

func NewHipChatNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewHipChatNotifier is the constructor functions for the HipChatNotifier

func NewKafkaNotifier

func NewKafkaNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewKafkaNotifier is the constructor function for the Kafka notifier.

func NewLINENotifier

func NewLINENotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewLINENotifier is the constructor for the LINE notifier

func NewOpsGenieNotifier

func NewOpsGenieNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewOpsGenieNotifier is the constructor for OpsGenie.

func NewPagerdutyNotifier

func NewPagerdutyNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewPagerdutyNotifier is the constructor for the PagerDuty notifier

func NewPushoverNotifier

func NewPushoverNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewPushoverNotifier is the constructor for the Pushover Notifier

func NewSensuNotifier

func NewSensuNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewSensuNotifier is the constructor for the Sensu Notifier.

func NewSlackNotifier

func NewSlackNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewSlackNotifier is the constructor for the Slack notifier

func NewTeamsNotifier

func NewTeamsNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewTeamsNotifier is the constructor for Teams notifier.

func NewTelegramNotifier

func NewTelegramNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewTelegramNotifier is the constructor for the Telegram notifier

func NewThreemaNotifier

func NewThreemaNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewThreemaNotifier is the constructor for the Threema notifier

func NewVictoropsNotifier

func NewVictoropsNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewVictoropsNotifier creates an instance of VictoropsNotifier that handles posting notifications to Victorops REST API

func NewWebHookNotifier

func NewWebHookNotifier(model *models.AlertNotification) (alerting.Notifier, error)

NewWebHookNotifier is the constructor for the WebHook notifier.

Types

type AlertmanagerNotifier

type AlertmanagerNotifier struct {
	NotifierBase
	URL               []string
	BasicAuthUser     string
	BasicAuthPassword string
	// contains filtered or unexported fields
}

AlertmanagerNotifier sends alert notifications to the alert manager

func (*AlertmanagerNotifier) Notify

func (am *AlertmanagerNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends alert notifications to the alert manager

func (*AlertmanagerNotifier) ShouldNotify

func (am *AlertmanagerNotifier) ShouldNotify(ctx context.Context, evalContext *alerting.EvalContext, notificationState *models.AlertNotificationState) bool

ShouldNotify returns true if the notifiers should be used depending on state

type DingDingNotifier

type DingDingNotifier struct {
	NotifierBase
	MsgType string
	URL     string
	// contains filtered or unexported fields
}

DingDingNotifier is responsible for sending alert notifications to ding ding.

func (*DingDingNotifier) Notify

func (dd *DingDingNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends the alert notification to dingding.

type DiscordNotifier

type DiscordNotifier struct {
	NotifierBase
	Content    string
	WebhookURL string
	// contains filtered or unexported fields
}

DiscordNotifier is responsible for sending alert notifications to discord.

func (*DiscordNotifier) Notify

func (dn *DiscordNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to Discord.

type EmailNotifier

type EmailNotifier struct {
	NotifierBase
	Addresses   []string
	SingleEmail bool
	// contains filtered or unexported fields
}

EmailNotifier is responsible for sending alert notifications over email.

func (*EmailNotifier) Notify

func (en *EmailNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends the alert notification.

type GoogleChatNotifier

type GoogleChatNotifier struct {
	NotifierBase
	URL string
	// contains filtered or unexported fields
}

GoogleChatNotifier is responsible for sending alert notifications to Google chat.

func (*GoogleChatNotifier) Notify

func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to Google Chat.

type HipChatNotifier

type HipChatNotifier struct {
	NotifierBase
	URL    string
	APIKey string
	RoomID string
	// contains filtered or unexported fields
}

HipChatNotifier is responsible for sending alert notifications to Hipchat.

func (*HipChatNotifier) Notify

func (hc *HipChatNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends an alert notification to HipChat

type KafkaNotifier

type KafkaNotifier struct {
	NotifierBase
	Endpoint string
	Topic    string
	// contains filtered or unexported fields
}

KafkaNotifier is responsible for sending alert notifications to Kafka.

func (*KafkaNotifier) Notify

func (kn *KafkaNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends the alert notification.

type LineNotifier

type LineNotifier struct {
	NotifierBase
	Token string
	// contains filtered or unexported fields
}

LineNotifier is responsible for sending alert notifications to LINE.

func (*LineNotifier) Notify

func (ln *LineNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to LINE

type NotifierBase

type NotifierBase struct {
	Name                  string
	Type                  string
	UID                   string
	IsDefault             bool
	UploadImage           bool
	SendReminder          bool
	DisableResolveMessage bool
	Frequency             time.Duration
	// contains filtered or unexported fields
}

NotifierBase is the base implementation of a notifier.

func NewNotifierBase

func NewNotifierBase(model *models.AlertNotification) NotifierBase

NewNotifierBase returns a new `NotifierBase`.

func (*NotifierBase) GetDisableResolveMessage

func (n *NotifierBase) GetDisableResolveMessage() bool

GetDisableResolveMessage returns true if ok alert notifications should be skipped.

func (*NotifierBase) GetFrequency

func (n *NotifierBase) GetFrequency() time.Duration

GetFrequency returns the frequency for how often alerts should be evaluated.

func (*NotifierBase) GetIsDefault

func (n *NotifierBase) GetIsDefault() bool

GetIsDefault returns true if the notifiers should be used for all alerts.

func (*NotifierBase) GetNotifierUID

func (n *NotifierBase) GetNotifierUID() string

GetNotifierUID returns the notifier `uid`.

func (*NotifierBase) GetSendReminder

func (n *NotifierBase) GetSendReminder() bool

GetSendReminder returns true if reminders should be sent.

func (*NotifierBase) GetType

func (n *NotifierBase) GetType() string

GetType returns the notifier type.

func (*NotifierBase) NeedsImage

func (n *NotifierBase) NeedsImage() bool

NeedsImage returns true if an image is expected in the notification.

func (*NotifierBase) ShouldNotify

func (n *NotifierBase) ShouldNotify(ctx context.Context, context *alerting.EvalContext, notifierState *models.AlertNotificationState) bool

ShouldNotify checks this evaluation should send an alert notification

type OpsGenieNotifier

type OpsGenieNotifier struct {
	NotifierBase
	APIKey           string
	APIUrl           string
	AutoClose        bool
	OverridePriority bool
	// contains filtered or unexported fields
}

OpsGenieNotifier is responsible for sending alert notifications to OpsGenie

func (*OpsGenieNotifier) Notify

func (on *OpsGenieNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends an alert notification to OpsGenie.

type PagerdutyNotifier

type PagerdutyNotifier struct {
	NotifierBase
	Key              string
	Severity         string
	AutoResolve      bool
	MessageInDetails bool
	// contains filtered or unexported fields
}

PagerdutyNotifier is responsible for sending alert notifications to pagerduty

func (*PagerdutyNotifier) Notify

func (pn *PagerdutyNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends an alert notification to PagerDuty

type PushoverNotifier

type PushoverNotifier struct {
	NotifierBase
	UserKey       string
	APIToken      string
	Priority      int
	Retry         int
	Expire        int
	Device        string
	AlertingSound string
	OkSound       string
	Upload        bool
	// contains filtered or unexported fields
}

PushoverNotifier is responsible for sending alert notifications to Pushover

func (*PushoverNotifier) Notify

func (pn *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends a alert notification to Pushover

type SensuNotifier

type SensuNotifier struct {
	NotifierBase
	URL      string
	Source   string
	User     string
	Password string
	Handler  string
	// contains filtered or unexported fields
}

SensuNotifier is responsible for sending alert notifications to Sensu.

func (*SensuNotifier) Notify

func (sn *SensuNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send alert notification to Sensu

type SlackNotifier

type SlackNotifier struct {
	NotifierBase
	URL            string
	Recipient      string
	Username       string
	IconEmoji      string
	IconURL        string
	MentionUsers   []string
	MentionGroups  []string
	MentionChannel string
	Token          string
	Upload         bool
	// contains filtered or unexported fields
}

SlackNotifier is responsible for sending alert notification to Slack.

func (*SlackNotifier) Notify

func (sn *SlackNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send alert notification to Slack.

type TeamsNotifier

type TeamsNotifier struct {
	NotifierBase
	URL string
	// contains filtered or unexported fields
}

TeamsNotifier is responsible for sending alert notifications to Microsoft teams.

func (*TeamsNotifier) Notify

func (tn *TeamsNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to Microsoft teams.

type TelegramNotifier

type TelegramNotifier struct {
	NotifierBase
	BotToken    string
	ChatID      string
	UploadImage bool
	// contains filtered or unexported fields
}

TelegramNotifier is responsible for sending alert notifications to Telegram.

func (*TelegramNotifier) Notify

func (tn *TelegramNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to Telegram.

type ThreemaNotifier

type ThreemaNotifier struct {
	NotifierBase
	GatewayID   string
	RecipientID string
	APISecret   string
	// contains filtered or unexported fields
}

ThreemaNotifier is responsible for sending alert notifications to Threema.

func (*ThreemaNotifier) Notify

func (notifier *ThreemaNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send an alert notification to Threema

type VictoropsNotifier

type VictoropsNotifier struct {
	NotifierBase
	URL             string
	NoDataAlertType string
	AutoResolve     bool
	// contains filtered or unexported fields
}

VictoropsNotifier defines URL property for Victorops REST API and handles notification process by formatting POST body according to Victorops specifications (http://victorops.force.com/knowledgebase/articles/Integration/Alert-Ingestion-API-Documentation/)

func (*VictoropsNotifier) Notify

func (vn *VictoropsNotifier) Notify(evalContext *alerting.EvalContext) error

Notify sends notification to Victorops via POST to URL endpoint

type WebhookNotifier

type WebhookNotifier struct {
	NotifierBase
	URL        string
	User       string
	Password   string
	HTTPMethod string
	// contains filtered or unexported fields
}

WebhookNotifier is responsible for sending alert notifications as webhooks.

func (*WebhookNotifier) Notify

func (wn *WebhookNotifier) Notify(evalContext *alerting.EvalContext) error

Notify send alert notifications as webhook as http requests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL