Added default alerts, updated UI to show alerts with checks, added auto sync for manual file editing
This commit is contained in:
@@ -169,6 +169,7 @@ func (d *Daemon) buildStatus() transport.StatusResponse {
|
||||
})
|
||||
}
|
||||
for _, c := range snap.Checks {
|
||||
check := c
|
||||
cs := transport.CheckSnapshot{CheckID: c.ID, Name: c.Name, State: "unknown"}
|
||||
if agg, ok := d.aggregator.SnapshotFor(c.ID); ok {
|
||||
cs.State = string(agg.State)
|
||||
@@ -176,6 +177,13 @@ func (d *Daemon) buildStatus() transport.StatusResponse {
|
||||
cs.Total = agg.Reports
|
||||
cs.Detail = agg.Detail
|
||||
}
|
||||
for _, a := range d.cluster.EffectiveAlertsFor(&check) {
|
||||
label := a.Name
|
||||
if a.Default {
|
||||
label += "*"
|
||||
}
|
||||
cs.Alerts = append(cs.Alerts, label)
|
||||
}
|
||||
out.Checks = append(out.Checks, cs)
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user