notifier

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2014 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYSTEM_HEALTHY  string = "HEALTHY"
	SYSTEM_UNSTABLE string = "UNSTABLE"
	SYSTEM_CRITICAL string = "CRITICAL"
)
View Source
const SlackUrl = "https://%s.slack.com/services/hooks/incoming-webhook?token=%s"

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 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 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:"-"`
	Team        string `json:"-"`
	Token       string `json:"-"`
	Channel     string `json:"channel"`
	Username    string `json:"username"`
	IconUrl     string `json:"icon_url"`
	IconEmoji   string `json:"icon_emoji"`
	Text        string `json:"text"`
}

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