报警任务状态改变时 清除另一个状态的muteLabel
This commit is contained in:
parent
a4fd818f02
commit
48802cc432
@ -164,6 +164,9 @@ func checkStatus() {
|
|||||||
}), server.Name, IPDesensitize(server.Host.IP), alert.Name)
|
}), server.Name, IPDesensitize(server.Host.IP), alert.Name)
|
||||||
go SendTriggerTasks(alert.FailTriggerTasks, curServer.ID)
|
go SendTriggerTasks(alert.FailTriggerTasks, curServer.ID)
|
||||||
go SendNotification(alert.NotificationTag, message, NotificationMuteLabel.ServerIncident(server.ID, alert.ID), &curServer)
|
go SendNotification(alert.NotificationTag, message, NotificationMuteLabel.ServerIncident(server.ID, alert.ID), &curServer)
|
||||||
|
// 清除恢复通知的静音缓存
|
||||||
|
resolvedMuteLabel := fmt.Sprintf("%s:%s", *NotificationMuteLabel.ServerIncidentResolved(server.ID, alert.ID), alert.NotificationTag)
|
||||||
|
Cache.Delete(resolvedMuteLabel)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 本次通过检查但上一次的状态为失败,则发送恢复通知
|
// 本次通过检查但上一次的状态为失败,则发送恢复通知
|
||||||
@ -173,6 +176,9 @@ func checkStatus() {
|
|||||||
}), server.Name, IPDesensitize(server.Host.IP), alert.Name)
|
}), server.Name, IPDesensitize(server.Host.IP), alert.Name)
|
||||||
go SendTriggerTasks(alert.RecoverTriggerTasks, curServer.ID)
|
go SendTriggerTasks(alert.RecoverTriggerTasks, curServer.ID)
|
||||||
go SendNotification(alert.NotificationTag, message, NotificationMuteLabel.ServerIncidentResolved(server.ID, alert.ID), &curServer)
|
go SendNotification(alert.NotificationTag, message, NotificationMuteLabel.ServerIncidentResolved(server.ID, alert.ID), &curServer)
|
||||||
|
// 清除失败通知的静音缓存
|
||||||
|
incidentMuteLabel := fmt.Sprintf("%s:%s", *NotificationMuteLabel.ServerIncident(server.ID, alert.ID), alert.NotificationTag)
|
||||||
|
Cache.Delete(incidentMuteLabel)
|
||||||
}
|
}
|
||||||
alertsPrevState[alert.ID][server.ID] = _RuleCheckPass
|
alertsPrevState[alert.ID][server.ID] = _RuleCheckPass
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user