Versions in this module Expand all Collapse all v0 v0.0.4 Jun 23, 2022 v0.0.3 Jun 22, 2022 v0.0.2 Jun 22, 2022 v0.0.1 Jun 9, 2022 Changes in this version + func GenHash(s string) string + func GetNotificationChains(n map[string]*Notification) [][]string + func ValidateSystemConf(sc SystemConfProvider) error + type ActionNotificationContext struct + ActionType models.ActionType + Message string + States []*ActionNotificationIncidentState + User string + func (a ActionNotificationContext) IncidentLink(i int64) string + type ActionNotificationIncidentState struct + AlertVars Vars + type Alert struct + AlertTemplateKeys map[string]*template.Template + Crit *expr.Expr + CritNotification *Notifications + Depends *expr.Expr + IgnoreUnknown bool + Log bool + MaxLogFrequency time.Duration + Name string + RawSquelch []string + ReturnType models.FuncType + RunEvery int + Squelch Squelches + TemplateName string + Text string + UnjoinedOK bool + Unknown time.Duration + UnknownsNormal bool + Warn *expr.Expr + WarnNotification *Notifications + type AnnotateConf struct + ClientOptions ESClientOptions + Hosts []string + Index string + SimpleClient bool + Version string + type AuthConf struct + AuthDisabled bool + CookieSecret string + LDAP LDAPConf + TokenSecret string + type AzureMonitorConf struct + ClientId string + ClientSecret string + Concurrency int + DebugRequest bool + DebugResponse bool + SubscriptionId string + TenantId string + func (ac AzureMonitorConf) Valid() error + type BulkEditRequest []EditRequest + type ByteSize float64 + const EB + const GB + const KB + const MB + const PB + const TB + const YB + const ZB + func (b ByteSize) String() string + type CloudWatchConf struct + Concurrency int + Enabled bool + ExpansionLimit int + PagesLimit int + func (c CloudWatchConf) Valid() error + type DBConf struct + LedisBindAddr string + LedisDir string + RedisClientSetName bool + RedisDb int + RedisHost string + RedisMasterName string + RedisPassword string + RedisSentinels []string + type Duration struct + func (d *Duration) UnmarshalText(text []byte) error + type ESClientOptions struct + BasicAuthPassword string + BasicAuthUsername string + Enabled bool + GzipEnabled bool + HealthcheckEnabled bool + HealthcheckInterval time.Duration + HealthcheckTimeout time.Duration + HealthcheckTimeoutStartup time.Duration + MaxRetries int + Scheme string + SnifferEnabled bool + SnifferInterval time.Duration + SnifferTimeout time.Duration + SnifferTimeoutStartup time.Duration + type EditRequest struct + Delete bool + Name string + Text string + Type string + type ElasticConf AnnotateConf + type EnabledBackends struct + Annotate bool + AzureMonitor bool + CloudWatch bool + Elastic bool + Graphite bool + Influx bool + OpenTSDB bool + Prom bool + type Entry struct + Def string + Name string + type ExprEntry struct + AlertKey models.AlertKey + Values map[string]string + type ExprLookup struct + Entries []*ExprEntry + Tags []string + func (lookup *ExprLookup) Get(key string, tag opentsdb.TagSet) (value string, ok bool) + type GraphiteConf struct + Headers map[string]string + Host string + type InfluxConf struct + Password string + Precision string + Timeout Duration + URL string + UnsafeSSL bool + UserAgent string + Username string + type LDAPConf struct + AllowInsecure bool + DefaultPermission string + Domain string + Groups []LDAPGroup + LdapAddr string + RootSearchPath string + UserBaseDn string + Users map[string]string + type LDAPGroup struct + Path string + Role string + type Locator interface + type Lookup struct + Entries []*Entry + Name string + Tags []string + Text string + func (lookup *Lookup) ToExpr() *ExprLookup + type Macro struct + Name string + Pairs interface{} + Text string + type Notification struct + ActionTemplateKeys map[models.ActionType]*NotificationTemplateKeys + ContentType string + Email []*mail.Address + Get *url.URL + GroupActions bool + Name string + Next *Notification + NextName string + Post *url.URL + Print bool + RawEmail string + RawGet string + RawPost string + RunOnActions string + Text string + Timeout time.Duration + UnknownMinGroupSize *int + UnknownMultiTemplateKeys NotificationTemplateKeys + UnknownTemplateKeys NotificationTemplateKeys + UnknownThreshold *int + func (n *Notification) NotifyAction(at models.ActionType, t *Template, c SystemConfProvider, ...) + func (n *Notification) NotifyAlert(rt *models.RenderedTemplates, c SystemConfProvider, ak string, ...) + func (n *Notification) NotifyMultipleUnknowns(t *Template, c SystemConfProvider, groups map[string]models.AlertKeys, ...) + func (n *Notification) NotifyUnknown(t *Template, c SystemConfProvider, name string, aks []models.AlertKey, ...) + func (n *Notification) PrepEmail(subject, body string, ak string, attachments []*models.Attachment) *PreparedEmail + func (n *Notification) PrepHttp(method string, url string, body string, alertDetails *NotificationDetails) *PreparedHttp + func (n *Notification) PrepareAction(at models.ActionType, t *Template, c SystemConfProvider, ...) *PreparedNotifications + func (n *Notification) PrepareAlert(rt *models.RenderedTemplates, ak string, attachments ...*models.Attachment) *PreparedNotifications + func (n *Notification) PrepareMultipleUnknowns(t *Template, c SystemConfProvider, groups map[string]models.AlertKeys, ...) *PreparedNotifications + func (n *Notification) PrepareUnknown(t *Template, c SystemConfProvider, name string, aks []models.AlertKey, ...) *PreparedNotifications + func (n *Notification) RunOnActionType(at models.ActionType) bool + func (n *Notification) SendHttp(method string, url string, body string) + type NotificationDetails struct + Ak []string + At string + NotifyName string + NotifyType int + TemplateKey string + type NotificationTemplateKeys struct + BodyTemplate string + EmailSubjectTemplate string + GetTemplate string + PostTemplate string + func (n *NotificationTemplateKeys) Combine(defaults *NotificationTemplateKeys) *NotificationTemplateKeys + type Notifications struct + Lookups map[string]*Lookup + Notifications map[string]*Notification + func (ns *Notifications) Get(c RuleConfProvider, tags opentsdb.TagSet) map[string]*Notification + func (ns *Notifications) GetAllChained() map[string]*Notification + type OpenTSDBConf struct + Host string + ResponseLimit int64 + Version opentsdb.Version + type PreparedEmail struct + AK string + Attachments []*models.Attachment + Body string + Subject string + To []string + func (p *PreparedEmail) Send(c SystemConfProvider) error + type PreparedHttp struct + Body string + Details *NotificationDetails + Headers map[string]string + Method string + URL string + func (p *PreparedHttp) Send() (int, error) + type PreparedNotifications struct + Email *PreparedEmail + Errors []string + HTTP []*PreparedHttp + Name string + Print bool + func (p *PreparedNotifications) Send(c SystemConfProvider) (errs []error) + type PromConf struct + URL string + func (pc PromConf) Valid() error + type RuleConfProvider interface + AlertSquelched func(*Alert) func(opentsdb.TagSet) bool + Expand func(string, map[string]string, bool) string + GetAlert func(string) *Alert + GetAlerts func() map[string]*Alert + GetFuncs func(EnabledBackends) map[string]parse.Func + GetLookup func(string) *Lookup + GetNotification func(string) *Notification + GetNotifications func() map[string]*Notification + GetTemplate func(string) *Template + Squelched func(*Alert, opentsdb.TagSet) bool + type RuleConfWriter interface + BulkEdit func(BulkEditRequest) error + GetHash func() string + GetRawText func() string + RawDiff func(rawConf string) (string, error) + SaveRawText func(rawConf, diff, user, message string, args ...string) error + SetReload func(reload func() error) + SetSaveHook func(SaveHook) + type SMTPConf struct + EmailFrom string + Host string + Password string + Username string + type SaveHook func(files, user, message string, args ...string) error + func MakeSaveCommandHook(cmdName string) (f SaveHook, err error) + type Squelch map[string]*regexp.Regexp + func (s Squelch) Squelched(tags opentsdb.TagSet) bool + type Squelches []Squelch + func (s *Squelches) Add(v string) error + func (s *Squelches) Squelched(tags opentsdb.TagSet) bool + type SystemConf struct + AlertCheckDistribution string + AnnotateConf AnnotateConf + AuthConf *AuthConf + AzureMonitorConf map[string]AzureMonitorConf + CheckFrequency Duration + CloudWatchConf CloudWatchConf + CommandHookPath string + DBConf DBConf + DefaultRunEvery int + ElasticConf map[string]ElasticConf + EnableReload bool + EnableSave bool + ExampleExpression string + GraphiteConf GraphiteConf + HTTPListen string + HTTPSListen string + Hostname string + InfluxConf InfluxConf + InternetProxy string + MaxRenderedTemplateAge int + MinGroupSize int + OpenTSDBConf OpenTSDBConf + Ping bool + PingDuration Duration + PromConf map[string]PromConf + RuleFilePath string + RuleVars map[string]string + SMTPConf SMTPConf + Scheme string + SearchSince Duration + ShortURLKey string + TLSCertFile string + TLSKeyFile string + TimeAndDate []int + UnknownThreshold int + func LoadSystemConfig(conf string) (*SystemConf, error) + func LoadSystemConfigFile(fileName string) (*SystemConf, error) + func (sc *SystemConf) AnnotateEnabled() bool + func (sc *SystemConf) EnabledBackends() EnabledBackends + func (sc *SystemConf) GetAlertCheckDistribution() string + func (sc *SystemConf) GetAnnotateElasticHosts() expr.ElasticConfig + func (sc *SystemConf) GetAnnotateIndex() string + func (sc *SystemConf) GetAuthConf() *AuthConf + func (sc *SystemConf) GetAzureMonitorContext() expr.AzureMonitorClients + func (sc *SystemConf) GetCheckFrequency() time.Duration + func (sc *SystemConf) GetCloudWatchContext() cloudwatch.Context + func (sc *SystemConf) GetCommandHookPath() string + func (sc *SystemConf) GetDefaultRunEvery() int + func (sc *SystemConf) GetElasticContext() expr.ElasticHosts + func (sc *SystemConf) GetEmailFrom() string + func (sc *SystemConf) GetExampleExpression() string + func (sc *SystemConf) GetGraphiteContext() graphite.Context + func (sc *SystemConf) GetHTTPListen() string + func (sc *SystemConf) GetHTTPSListen() string + func (sc *SystemConf) GetInfluxContext() client.HTTPConfig + func (sc *SystemConf) GetInternetProxy() string + func (sc *SystemConf) GetLedisBindAddr() string + func (sc *SystemConf) GetLedisDir() string + func (sc *SystemConf) GetMaxRenderedTemplateAge() int + func (sc *SystemConf) GetMinGroupSize() int + func (sc *SystemConf) GetPing() bool + func (sc *SystemConf) GetPingDuration() time.Duration + func (sc *SystemConf) GetPromContext() expr.PromClients + func (sc *SystemConf) GetRedisDb() int + func (sc *SystemConf) GetRedisHost() []string + func (sc *SystemConf) GetRedisMasterName() string + func (sc *SystemConf) GetRedisPassword() string + func (sc *SystemConf) GetRuleFilePath() string + func (sc *SystemConf) GetRuleVars() map[string]string + func (sc *SystemConf) GetSMTPHost() string + func (sc *SystemConf) GetSMTPPassword() string + func (sc *SystemConf) GetSMTPUsername() string + func (sc *SystemConf) GetSearchSince() time.Duration + func (sc *SystemConf) GetShortURLKey() string + func (sc *SystemConf) GetSystemConfProvider() (SystemConfProvider, error) + func (sc *SystemConf) GetTLSCertFile() string + func (sc *SystemConf) GetTLSKeyFile() string + func (sc *SystemConf) GetTSDBContext() opentsdb.Context + func (sc *SystemConf) GetTSDBHost() string + func (sc *SystemConf) GetTimeAndDate() []int + func (sc *SystemConf) GetUnknownThreshold() int + func (sc *SystemConf) IsRedisClientSetName() bool + func (sc *SystemConf) MakeLink(path string, v *url.Values) string + func (sc *SystemConf) ReloadEnabled() bool + func (sc *SystemConf) SaveEnabled() bool + func (sc *SystemConf) SetTSDBHost(tsdbHost string) + type SystemConfProvider interface + AnnotateEnabled func() bool + EnabledBackends func() EnabledBackends + GetAlertCheckDistribution func() string + GetAnnotateElasticHosts func() expr.ElasticConfig + GetAnnotateIndex func() string + GetAuthConf func() *AuthConf + GetAzureMonitorContext func() expr.AzureMonitorClients + GetCheckFrequency func() time.Duration + GetCloudWatchContext func() cloudwatch.Context + GetCommandHookPath func() string + GetDefaultRunEvery func() int + GetElasticContext func() expr.ElasticHosts + GetEmailFrom func() string + GetExampleExpression func() string + GetGraphiteContext func() graphite.Context + GetHTTPListen func() string + GetHTTPSListen func() string + GetInfluxContext func() client.HTTPConfig + GetInternetProxy func() string + GetLedisBindAddr func() string + GetLedisDir func() string + GetMaxRenderedTemplateAge func() int + GetMinGroupSize func() int + GetPing func() bool + GetPingDuration func() time.Duration + GetPromContext func() expr.PromClients + GetRedisDb func() int + GetRedisHost func() []string + GetRedisMasterName func() string + GetRedisPassword func() string + GetRuleFilePath func() string + GetRuleVars func() map[string]string + GetSMTPHost func() string + GetSMTPPassword func() string + GetSMTPUsername func() string + GetSearchSince func() time.Duration + GetShortURLKey func() string + GetTLSCertFile func() string + GetTLSKeyFile func() string + GetTSDBContext func() opentsdb.Context + GetTSDBHost func() string + GetTimeAndDate func() []int + GetUnknownThreshold func() int + IsRedisClientSetName func() bool + MakeLink func(string, *url.Values) string + ReloadEnabled func() bool + SaveEnabled func() bool + SetTSDBHost func(tsdbHost string) + type Template struct + Body *template.Template + CustomTemplates map[string]*template.Template + Name string + RawBody string + RawCustoms map[string]string + RawSubject string + Subject *template.Template + Text string + func (t *Template) Get(name string) *template.Template + type URL struct + func (u *URL) UnmarshalText(text []byte) error + type Vars map[string]string