|
@@ -330,7 +330,8 @@ func (e *EventHandler) CreateEventRecord(chdb *gorm.DB) *EventHandler {
|
|
e.Errs["CreateEventRecord_func(Create)"] = err
|
|
e.Errs["CreateEventRecord_func(Create)"] = err
|
|
logger.Error("create emos err:", err.Error())
|
|
logger.Error("create emos err:", err.Error())
|
|
}
|
|
}
|
|
- if e.JR.AlertStatus == FIRING {
|
|
|
|
|
|
+ //发生告警,生成告警数据
|
|
|
|
+ if e.JR.AlertStatus >= FIRING {
|
|
e.Emo = &emo
|
|
e.Emo = &emo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -338,7 +339,7 @@ func (e *EventHandler) CreateEventRecord(chdb *gorm.DB) *EventHandler {
|
|
}
|
|
}
|
|
|
|
|
|
func (e *EventHandler) CreateAlert(db *gorm.DB) *EventHandler {
|
|
func (e *EventHandler) CreateAlert(db *gorm.DB) *EventHandler {
|
|
- if e.JR.AlertStatus == FIRING || e.JR.AlertStatus == SENDSUCCESS {
|
|
|
|
|
|
+ if e.JR.AlertStatus >= FIRING {
|
|
//TODO: 发送至告警队列
|
|
//TODO: 发送至告警队列
|
|
fe := amodels.OtFireEvents{
|
|
fe := amodels.OtFireEvents{
|
|
AppId: e.Emo.AppID,
|
|
AppId: e.Emo.AppID,
|