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 + var DefaultClient *http.Client + var DefaultSched = &Schedule + func Autostyle(i int) chart.Style + func Close(reload bool) + func Load(systemConf conf.SystemConfProvider, ruleConf conf.RuleConfProvider, ...) error + func NewIncident(ak models.AlertKey) *models.IncidentState + func Reset() + func Run() error + type Battery struct + Status string + StatusLastUpdated int64 + type BoardPowerReading struct + Watts int64 + WattsLastUpdated int64 + type CDPCacheEntries []CDPCacheEntry + type CDPCacheEntry struct + DeviceID string + DevicePort string + type ChassisComponent struct + Status string + StatusLastUpdated int64 + type Context struct + Alert *conf.Alert + Attachments []*models.Attachment + ElasticHost string + Errors []string + IsEmail bool + func (c *Context) Ack() string + func (c *Context) AzureResourceLink(prefix, rType, rsg, name string) (link string) + func (c *Context) AzureResourceTags(prefix, rType, rsg, name string) map[string]string + func (c *Context) ESQuery(indexRoot expr.ESIndexer, filter expr.ESQuery, sduration, eduration string, ...) interface{} + func (c *Context) ESQueryAll(indexRoot expr.ESIndexer, filter expr.ESQuery, sduration, eduration string, ...) interface{} + func (c *Context) Eval(v interface{}) interface{} + func (c *Context) EvalAll(v interface{}) interface{} + func (c *Context) Expr(v string) string + func (c *Context) Get(name string) interface{} + func (c *Context) GetIncidentState(id int64) *models.IncidentState + func (c *Context) GetMeta(metric, name string, v interface{}) interface{} + func (c *Context) Graph(v interface{}, args ...string) interface{} + func (c *Context) GraphAll(v interface{}, args ...string) interface{} + func (c *Context) GraphLink(v string) string + func (c *Context) HTTPGet(url string) string + func (c *Context) HTTPGetJSON(url string) *jsonq.JsonQuery + func (c *Context) HTTPPost(url, bodyType, data string) string + func (c *Context) HostView(host string) string + func (c *Context) Incident() string + func (c *Context) Last() interface{} + func (c *Context) LastError() string + func (c *Context) LeftJoin(v ...interface{}) (interface{}, error) + func (c *Context) Lookup(table, key string) string + func (c *Context) LookupAll(table, key string, group interface{}) string + func (c *Context) Rule() string + func (c *Context) Set(name string, value interface{}) string + func (c *Context) Shorten(link string) string + func (c *Context) SlackAttachment() *slack.Attachment + func (c *Context) UseElastic(host string) interface{} + type Controller struct + Status string + StatusLastUpdated int64 + type Disk struct + Label string + StatsLastUpdated int64 + TotalBytes int64 + UsedBytes int64 + type EpochAction struct + Message string + Time int64 + Type models.ActionType + User string + func MakeEpochAction(a models.Action) EpochAction + type EventSummary struct + Status models.Status + Time int64 + func MakeEventSummary(e models.Event) (EventSummary, bool) + type Hardware struct + BoardPowerReading *BoardPowerReading + ChassisComponents map[string]*ChassisComponent + Memory map[string]*MemoryModule + PowerSupplies map[string]*PowerSupply + Storage struct{ ... } + Temps map[string]*Temp + type HostData struct + CPU struct{ ... } + Disks map[string]*Disk + Guests []string + Hardware *Hardware + ICMPData map[string]*ICMPData + Interfaces map[string]*HostInterface + Manufacturer string + Memory struct{ ... } + Model string + Name string + OS struct{ ... } + OpenIncidents []IncidentStatus + Processes map[string]*Process + SerialNumber string + Services map[string]*ServiceStatus + UptimeSeconds int64 + VM *VM + func (hd *HostData) Clean() + type HostInterface struct + CDPCacheEntries CDPCacheEntries + Description string + IPAddresses []string + Inbps int64 + LinkSpeed int64 + MAC string + Master string + Name string + Outbps int64 + RemoteMacs []string + StatsLastUpdated int64 + Type string + type ICMPData struct + DNSResolved bool + DNSResolvedLastUpdated int64 + RTTLastUpdated int64 + RTTMS float64 + TimedOut bool + TimedOutLastUpdated int64 + type IncidentStatus struct + Active bool + AlertKey models.AlertKey + IncidentID int64 + LastAbnormalStatus models.Status + LastAbnormalTime models.Epoch + NeedsAck bool + Silenced bool + Status models.Status + StatusTime int64 + Subject string + type IncidentSummaryView struct + Actions []EpochAction + AlertName string + CritNotificationChains [][]string + CurrentStatus models.Status + Events []EventSummary + Id int64 + LastAbnormalStatus models.Status + LastAbnormalTime models.Epoch + LastStatusTime int64 + NeedAck bool + Silenced bool + Start int64 + Subject string + Tags opentsdb.TagSet + TagsString string + Unevaluated bool + WarnNotificationChains [][]string + WorstStatus models.Status + func MakeIncidentSummary(c conf.RuleConfProvider, s SilenceTester, is *models.IncidentState) (*IncidentSummaryView, error) + func (is IncidentSummaryView) Ask(filter string) (bool, error) + type IncidentWithTemplates struct + type MemoryModule struct + Size string + Status string + StatusLastUpdated int64 + type PhysicalDisk struct + Status string + StatusLastUpdated int64 + type PowerSupply struct + Amps float64 + AmpsLastUpdated int64 + Status string + StatusLastUpdated int64 + Volts float64 + VoltsLastUpdated int64 + type Process struct + CPUPercentLastUpdated int64 + CPUPercentUsed float64 + Count int64 + CountLastUpdated int64 + UsedRealBytes int64 + UsedRealBytesLastUpdated int64 + UsedVirtualBytes int64 + UsedVirtualBytesLastUpdated int64 + type RunHistory struct + Backends *expr.Backends + Cache *cache.Cache + Events map[models.AlertKey]*models.Event + Start time.Time + func (rh *RunHistory) AtTime(t time.Time) *RunHistory + type Schedule struct + DataAccess database.DataAccess + LastCheck time.Time + RuleConf conf.RuleConfProvider + Search *search.Search + SystemConf conf.SystemConfProvider + func (s *Schedule) ActionByAlertKey(user, message string, t models.ActionType, at *time.Time, ak models.AlertKey) error + func (s *Schedule) ActionByIncidentId(user, message string, t models.ActionType, at *time.Time, id int64) (models.AlertKey, error) + func (s *Schedule) ActionNotify(at models.ActionType, user, message string, aks []models.AlertKey) error + func (s *Schedule) AddSilence(start, end time.Time, alert, tagList string, forget, confirm bool, ...) (map[models.AlertKey]bool, error) + func (s *Schedule) AlertSuccessful(name string) bool + func (s *Schedule) CheckAlert(T miniprofiler.Timer, r *RunHistory, a *conf.Alert) (cancelled bool) + func (s *Schedule) CheckExpr(T miniprofiler.Timer, rh *RunHistory, a *conf.Alert, e *expr.Expr, ...) (alerts models.AlertKeys, err error, cancelled bool) + func (s *Schedule) CheckNotifications() time.Time + func (s *Schedule) ClearErrors(alert string) error + func (s *Schedule) ClearSilence(id string) error + func (s *Schedule) Close(reload bool) + func (s *Schedule) CollectStates() + func (s *Schedule) Data(rh *RunHistory, st *models.IncidentState, a *conf.Alert, isEmail bool) *Context + func (s *Schedule) DeleteMetadata(tags opentsdb.TagSet, name string) error + func (s *Schedule) ExecuteAll(rh *RunHistory, a *conf.Alert, st *models.IncidentState, recordTimes bool) (*models.RenderedTemplates, []error) + func (s *Schedule) ExecuteBadTemplate(errs []error, rh *RunHistory, a *conf.Alert, st *models.IncidentState) (subject, body string, err error) + func (s *Schedule) ExecuteBody(rh *RunHistory, a *conf.Alert, st *models.IncidentState, isEmail bool) (string, []*models.Attachment, error) + func (s *Schedule) ExecuteSubject(rh *RunHistory, a *conf.Alert, st *models.IncidentState, isEmail bool) (string, error) + func (s *Schedule) ExprGraph(t miniprofiler.Timer, unit string, res []*expr.Result) (chart.Chart, error) + func (s *Schedule) ExprPNG(t miniprofiler.Timer, w io.Writer, width, height int, unit string, ...) error + func (s *Schedule) ExprSVG(t miniprofiler.Timer, w io.Writer, width, height int, unit string, ...) error + func (s *Schedule) GetCheckFrequency(alertName string) (time.Duration, error) + func (s *Schedule) GetLockStatus() (holder string, since time.Time) + func (s *Schedule) GetMetadata(metric string, subset opentsdb.TagSet) ([]metadata.Metasend, error) + func (s *Schedule) GetOpenStates() (States, error) + func (s *Schedule) GetQuiet() bool + func (s *Schedule) GetSilence(T miniprofiler.Timer, ak models.AlertKey) *models.Silence + func (s *Schedule) GetUnknownAndUnevaluatedAlertKeys(alert string) (unknown, uneval []models.AlertKey) + func (s *Schedule) Host(filter string) (map[string]*HostData, error) + func (s *Schedule) Init(name string, systemConf conf.SystemConfProvider, ...) error + func (s *Schedule) Lock(method string) + func (s *Schedule) MarshalGroups(T miniprofiler.Timer, filter string) (*StateGroups, error) + func (s *Schedule) MetadataMetrics(metric string) (*database.MetricMetadata, error) + func (s *Schedule) NewRunHistory(start time.Time, cache *cache.Cache) *RunHistory + func (s *Schedule) Notify(st *models.IncidentState, rt *models.RenderedTemplates, n *conf.Notification) bool + func (s *Schedule) PutMetadata(k metadata.Metakey, v interface{}) error + func (s *Schedule) QueueNotification(ak models.AlertKey, n *conf.Notification, time time.Time) error + func (s *Schedule) Reset() + func (s *Schedule) Run() error + func (s *Schedule) RunHistory(r *RunHistory) + func (s *Schedule) Silenced() SilenceTester + func (s *Schedule) Unlock() + type ServiceStatus struct + Running bool + RunningLastUpdated int64 + type SilenceTester func(models.AlertKey) *models.Silence + type StateGroup struct + Active bool + Ago string + Alert string + AlertKey models.AlertKey + Children []*StateGroup + CurrentStatus models.Status + IsError bool + Silenced bool + State *models.IncidentState + Status models.Status + Subject string + type StateGroups struct + FailingAlerts int + Groups struct{ ... } + TimeAndDate []int + UnclosedErrors int + type StateTuple struct + Active bool + CurrentStatus models.Status + NeedAck bool + Silenced bool + Status models.Status + type States map[models.AlertKey]*models.IncidentState + func (states States) GroupSets(minGroup int) map[string]models.AlertKeys + func (states States) GroupStates(silenced SilenceTester) map[StateTuple]States + type Temp struct + Celsius float64 + CelsiusLastUpdated int64 + Status string + StatusLastUpdated int64 + type VM struct + Host string + PowerState string + PowerStateLastUpdated int64 + type VirtualDisk struct + Status string + StatusLastUpdated int64