Documentation ¶
Index ¶
- func Send(e *email.Email, addr string) error
- func SendMail(addr string, from string, to []string, msg []byte) error
- type Alert
- type AlertTemplateStrings
- type Attachment
- type ByteSize
- type Conf
- func (c *Conf) AlertSquelched(a *Alert) func(opentsdb.TagSet) bool
- func (c *Conf) AlertTemplateStrings() (*AlertTemplateStrings, error)
- func (c *Conf) Expand(v string, vars map[string]string, ignoreBadExpand bool) string
- func (c *Conf) GetLookups() map[string]*expr.Lookup
- func (c *Conf) Squelched(a *Alert, tags opentsdb.TagSet) bool
- type Entry
- type Lookup
- type Macro
- type Notification
- func (n *Notification) DoEmail(subject, body []byte, c *Conf, ak string, attachments ...*Attachment)
- func (n *Notification) DoGet()
- func (n *Notification) DoPost(subject []byte)
- func (n *Notification) DoPrint(subject []byte)
- func (n *Notification) MarshalJSON() ([]byte, error)
- func (n *Notification) Notify(subject, body []byte, c *Conf, ak string, attachments ...*Attachment)
- type Notifications
- type Squelch
- type Squelches
- type Template
- type Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alert ¶
type Alert struct { Def string Vars *Template `json:"-"` Name string Crit *expr.Expr `json:",omitempty"` Warn *expr.Expr `json:",omitempty"` Squelch Squelches `json:"-"` CritNotification *Notifications WarnNotification *Notifications Unknown time.Duration IgnoreUnknown bool Macros []string `json:"-"` UnjoinedOK bool `json:",omitempty"` // contains filtered or unexported fields }
type AlertTemplateStrings ¶
type Attachment ¶
type Conf ¶
type Conf struct { Vars Name string // Config file name CheckFrequency time.Duration // Time between alert checks: 5m WebDir string // Static content web directory: web TsdbHost string // OpenTSDB relay and query destination: ny-devtsdb04:4242 HttpListen string // Web server listen address: :80 RelayListen string // OpenTSDB relay listen address: :4242 SmtpHost string // SMTP address: ny-mail:25 Ping bool EmailFrom string StateFile string TimeAndDate []int // timeanddate.com cities list ResponseLimit int64 UnknownTemplate *Template Templates map[string]*Template Alerts map[string]*Alert Notifications map[string]*Notification `json:"-"` RawText string Macros map[string]*Macro Lookups map[string]*Lookup Squelch Squelches `json:"-"` Quiet bool // contains filtered or unexported fields }
func (*Conf) AlertTemplateStrings ¶
func (c *Conf) AlertTemplateStrings() (*AlertTemplateStrings, error)
func (*Conf) GetLookups ¶
GetLookups converts all lookup tables to maps for use by the expr package.
type Notification ¶
type Notification struct { Def string Vars Name string Email []*mail.Address Post, Get *url.URL Body *ttemplate.Template Print bool Next *Notification Timeout time.Duration // contains filtered or unexported fields }
func (*Notification) DoEmail ¶
func (n *Notification) DoEmail(subject, body []byte, c *Conf, ak string, attachments ...*Attachment)
func (*Notification) DoGet ¶
func (n *Notification) DoGet()
func (*Notification) DoPost ¶
func (n *Notification) DoPost(subject []byte)
func (*Notification) DoPrint ¶
func (n *Notification) DoPrint(subject []byte)
func (*Notification) MarshalJSON ¶
func (n *Notification) MarshalJSON() ([]byte, error)
func (*Notification) Notify ¶
func (n *Notification) Notify(subject, body []byte, c *Conf, ak string, attachments ...*Attachment)
type Notifications ¶
type Notifications struct { Notifications map[string]*Notification `json:"-"` // Table key -> table Lookups map[string]*Lookup }
func (*Notifications) Get ¶
func (ns *Notifications) Get(c *Conf, tags opentsdb.TagSet) map[string]*Notification
Get returns the set of notifications based on given tags.
Click to show internal directories.
Click to hide internal directories.