consul

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2016 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypeBool = iota
	ConfigTypeString
	ConfigTypeInt
	ConfigTypeStrArray
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsSnsNotifierConfig added in v0.4.0

type AwsSnsNotifierConfig struct {
	Enabled  bool
	Region   string
	TopicArn string
}

type Check

type Check struct {
	Node        string
	CheckID     string
	Name        string
	Status      string
	Notes       string
	Output      string
	ServiceID   string
	ServiceName string
}

type ChecksConfig

type ChecksConfig struct {
	Enabled         bool
	ChangeThreshold int
}

type Consul

type Consul interface {
	LoadConfig()

	EventsEnabled() bool
	ChecksEnabled() bool
	EventHandlers(eventName string) []string

	EmailConfig() *EmailNotifierConfig
	LogConfig() *LogNotifierConfig
	InfluxdbConfig() *InfluxdbNotifierConfig
	SlackConfig() *SlackNotifierConfig
	PagerDutyConfig() *PagerDutyNotifierConfig
	HipChatConfig() *HipChatNotifierConfig
	OpsGenieConfig() *OpsGenieNotifierConfig
	AwsSnsConfig() *AwsSnsNotifierConfig
	VictorOpsConfig() *VictorOpsNotifierConfig

	CheckChangeThreshold() int
	UpdateCheckData()
	NewAlerts() []Check
	NewAlertsWithFilter(node string, service string, checkId string, statuses []string, ignoreBlacklist bool) []Check

	IsBlacklisted(check *Check) bool

	CustomNotifiers() map[string]string

	CheckStatus(node, statusId, checkId string) (status, output string)
	CheckKeyExists(key string) bool

	GetProfileInfo(node, serviceID, checkID string) (notifiersList map[string]bool, interval int)

	GetReminders() []notifier.Message
	SetReminder(m notifier.Message)
	DeleteReminder(node string)
}

Consul interface provides access to consul client

type ConsulAlertClient

type ConsulAlertClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(address, dc, aclToken string) (*ConsulAlertClient, error)

func (*ConsulAlertClient) AwsSnsConfig added in v0.4.0

func (c *ConsulAlertClient) AwsSnsConfig() *AwsSnsNotifierConfig

func (*ConsulAlertClient) CheckChangeThreshold

func (c *ConsulAlertClient) CheckChangeThreshold() int

func (*ConsulAlertClient) CheckKeyExists added in v0.3.2

func (c *ConsulAlertClient) CheckKeyExists(key string) bool

func (*ConsulAlertClient) CheckStatus

func (c *ConsulAlertClient) CheckStatus(node, serviceId, checkId string) (status, output string)

func (*ConsulAlertClient) ChecksEnabled

func (c *ConsulAlertClient) ChecksEnabled() bool

func (*ConsulAlertClient) CustomNotifiers

func (c *ConsulAlertClient) CustomNotifiers() (customNotifs map[string]string)

CustomNotifiers returns a map of all custom notifiers and command path as the key value

func (*ConsulAlertClient) DeleteReminder added in v0.4.0

func (c *ConsulAlertClient) DeleteReminder(node string)

DeleteReminder deletes a reminder

func (*ConsulAlertClient) EmailConfig

func (c *ConsulAlertClient) EmailConfig() *EmailNotifierConfig

EmailConfig exports the email config

func (*ConsulAlertClient) EventHandlers

func (c *ConsulAlertClient) EventHandlers(eventName string) []string

func (*ConsulAlertClient) EventsEnabled

func (c *ConsulAlertClient) EventsEnabled() bool

func (*ConsulAlertClient) GetProfileInfo added in v0.4.0

func (c *ConsulAlertClient) GetProfileInfo(node, serviceID, checkID string) (notifiersList map[string]bool, interval int)

GetProfileInfo returns profile info for check

func (*ConsulAlertClient) GetReminders added in v0.4.0

func (c *ConsulAlertClient) GetReminders() []notifier.Message

GetReminders returns list of reminders

func (*ConsulAlertClient) HipChatConfig added in v0.3.1

func (c *ConsulAlertClient) HipChatConfig() *HipChatNotifierConfig

func (*ConsulAlertClient) InfluxdbConfig

func (c *ConsulAlertClient) InfluxdbConfig() *InfluxdbNotifierConfig

func (*ConsulAlertClient) IsBlacklisted added in v0.1.2

func (c *ConsulAlertClient) IsBlacklisted(check *Check) bool

IsBlacklisted gets the blacklist status of check

func (*ConsulAlertClient) LoadConfig

func (c *ConsulAlertClient) LoadConfig()

func (*ConsulAlertClient) LogConfig

func (c *ConsulAlertClient) LogConfig() *LogNotifierConfig

func (*ConsulAlertClient) NewAlerts

func (c *ConsulAlertClient) NewAlerts() []Check

NewAlerts returns a list of checks marked for notification

func (*ConsulAlertClient) NewAlertsWithFilter added in v0.4.0

func (c *ConsulAlertClient) NewAlertsWithFilter(nodeName string, serviceName string, checkName string, statuses []string, ignoreBlacklist bool) []Check

func (*ConsulAlertClient) OpsGenieConfig added in v0.3.3

func (c *ConsulAlertClient) OpsGenieConfig() *OpsGenieNotifierConfig

func (*ConsulAlertClient) PagerDutyConfig added in v0.1.2

func (c *ConsulAlertClient) PagerDutyConfig() *PagerDutyNotifierConfig

func (*ConsulAlertClient) SetReminder added in v0.4.0

func (c *ConsulAlertClient) SetReminder(m notifier.Message)

SetReminder sets a reminder

func (*ConsulAlertClient) SlackConfig

func (c *ConsulAlertClient) SlackConfig() *SlackNotifierConfig

func (*ConsulAlertClient) UpdateCheckData

func (c *ConsulAlertClient) UpdateCheckData()

func (*ConsulAlertClient) VictorOpsConfig added in v0.4.0

func (c *ConsulAlertClient) VictorOpsConfig() *VictorOpsNotifierConfig

VictorOpsConfig provides configuration for the VictorOps integration

type ConsulAlertConfig

type ConsulAlertConfig struct {
	Checks    *ChecksConfig
	Events    *EventsConfig
	Notifiers *NotifiersConfig
}

func DefaultAlertConfig

func DefaultAlertConfig() *ConsulAlertConfig

DefaultAlertConfig loads default config settings

type EmailNotifierConfig

type EmailNotifierConfig struct {
	ClusterName string
	Enabled     bool
	Url         string
	Port        int
	Username    string
	Password    string
	SenderAlias string
	SenderEmail string
	Receivers   []string
	Template    string
	OnePerAlert bool
	OnePerNode  bool
}

type Event

type Event struct {
	ID            string
	Name          string
	Payload       []byte
	NodeFilter    string
	ServiceFilter string
	TagFilter     string
	Version       uint
	LTime         uint
}

Event data from consul

type EventsConfig

type EventsConfig struct {
	Enabled  bool
	Handlers []string
}

type HipChatNotifierConfig added in v0.3.1

type HipChatNotifierConfig struct {
	Enabled     bool
	ClusterName string
	RoomId      string
	AuthToken   string
	BaseURL     string
	From        string
}

type InfluxdbNotifierConfig

type InfluxdbNotifierConfig struct {
	Enabled    bool
	Host       string
	Username   string
	Password   string
	Database   string
	SeriesName string
}

type LogNotifierConfig

type LogNotifierConfig struct {
	Enabled bool
	Path    string
}

type OpsGenieNotifierConfig added in v0.3.3

type OpsGenieNotifierConfig struct {
	Enabled     bool
	ClusterName string
	ApiKey      string
}

type PagerDutyNotifierConfig added in v0.1.2

type PagerDutyNotifierConfig struct {
	Enabled    bool
	ServiceKey string
	ClientName string
	ClientUrl  string
}

type ProfileInfo added in v0.4.0

type ProfileInfo struct {
	Interval  int
	NotifList map[string]bool
}

ProfileInfo is for reading in JSON from profile keys

type SlackNotifierConfig

type SlackNotifierConfig struct {
	Enabled     bool
	ClusterName string
	Url         string
	Channel     string
	Username    string
	IconUrl     string
	IconEmoji   string
	Detailed    bool
}

type Status

type Status struct {
	Current          string
	CurrentTimestamp time.Time
	Pending          string
	PendingTimestamp time.Time
	HealthCheck      *Check
	ForNotification  bool
}

type VictorOpsNotifierConfig added in v0.4.0

type VictorOpsNotifierConfig struct {
	Enabled    bool
	APIKey     string
	RoutingKey string
}

VictorOpsNotifierConfig provides configuration options for VictorOps notifier

Jump to

Keyboard shortcuts

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