notifier

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2014 License: GPL-2.0 Imports: 12 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
	Service   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 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