notifier

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2016 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYSTEM_HEALTHY  string = "HEALTHY"
	SYSTEM_UNSTABLE string = "UNSTABLE"
	SYSTEM_CRITICAL string = "CRITICAL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailData

type EmailData struct {
	ClusterName  string
	SystemStatus string
	FailCount    int
	WarnCount    int
	PassCount    int
	Nodes        map[string]Messages
}

func (EmailData) IsCritical

func (e EmailData) IsCritical() bool

func (EmailData) IsPassing

func (e EmailData) IsPassing() bool

func (EmailData) IsWarning

func (e EmailData) IsWarning() bool

type EmailNotifier

type EmailNotifier struct {
	ClusterName string
	Template    string
	Url         string
	Port        int
	Username    string
	Password    string
	SenderAlias string
	SenderEmail string
	Receivers   []string
}

func (*EmailNotifier) Notify

func (emailNotifier *EmailNotifier) Notify(alerts Messages) bool

type HipChatNotifier added in v0.3.1

type HipChatNotifier struct {
	ClusterName string
	RoomId      string
	AuthToken   string
	BaseURL     string
}

func (*HipChatNotifier) Notify added in v0.3.1

func (notifier *HipChatNotifier) Notify(messages Messages) bool

type InfluxdbNotifier

type InfluxdbNotifier struct {
	Host       string
	Username   string
	Password   string
	Database   string
	SeriesName string
}

func (*InfluxdbNotifier) Notify

func (influxdb *InfluxdbNotifier) Notify(messages Messages) bool

type LogNotifier

type LogNotifier struct {
	LogFile string
}

func (*LogNotifier) Notify

func (logNotifier *LogNotifier) Notify(alerts Messages) bool

type Message

type Message struct {
	Node      string
	ServiceId string
	Service   string
	CheckId   string
	Check     string
	Status    string
	Output    string
	Notes     string
	Timestamp time.Time
}

func (Message) IsCritical

func (m Message) IsCritical() bool

func (Message) IsPassing

func (m Message) IsPassing() bool

func (Message) IsWarning

func (m Message) IsWarning() bool

type Messages

type Messages []Message

func (Messages) Summary

func (m Messages) Summary() (overallStatus string, pass, warn, fail int)

type Notifier

type Notifier interface {
	Notify(alerts Messages) bool
}

type OpsGenieNotifier added in v0.3.3

type OpsGenieNotifier struct {
	ClusterName string
	ApiKey      string
}

func (*OpsGenieNotifier) Notify added in v0.3.3

func (opsgenie *OpsGenieNotifier) Notify(messages Messages) bool

func (*OpsGenieNotifier) Send added in v0.3.3

func (opsgenie *OpsGenieNotifier) Send(alertCli *ogcli.OpsGenieAlertClient, message string, content string) (*alerts.CreateAlertResponse, error)

type PagerDutyNotifier added in v0.1.2

type PagerDutyNotifier struct {
	ServiceKey string
	ClientName string
	ClientUrl  string
}

func (*PagerDutyNotifier) Notify added in v0.1.2

func (pd *PagerDutyNotifier) Notify(messages Messages) bool

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:"-"`
}

func (*SlackNotifier) Notify

func (slack *SlackNotifier) Notify(messages Messages) bool

Jump to

Keyboard shortcuts

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