diff --git a/cmd/server/houyi/internal/data/repoimpl/strategy.go b/cmd/server/houyi/internal/data/repoimpl/strategy.go index 062a98d19..56f40cbac 100644 --- a/cmd/server/houyi/internal/data/repoimpl/strategy.go +++ b/cmd/server/houyi/internal/data/repoimpl/strategy.go @@ -77,6 +77,7 @@ func (s *strategyRepositoryImpl) resolvedAlerts(ctx context.Context, strategy bo // Eval 评估策略 告警/恢复 func (s *strategyRepositoryImpl) Eval(ctx context.Context, strategy bo.IStrategy) (*bo.Alarm, error) { alarmInfo := strategy.BuilderAlarmBaseInfo() + // 恢复告警 if !strategy.GetStatus().IsEnable() { alerts := s.resolvedAlerts(ctx, strategy) alarmInfo.Alerts = alerts diff --git a/pkg/houyi/datasource/endpoint_port.go b/pkg/houyi/datasource/endpoint_port.go index ade99e2b0..15db47f28 100644 --- a/pkg/houyi/datasource/endpoint_port.go +++ b/pkg/houyi/datasource/endpoint_port.go @@ -23,12 +23,12 @@ func EndpointPortEval(_ context.Context, endpoint string, port uint32, timeout t Labels: labels.Map(), Values: []*Value{ { - Value: 0, + Value: 1, Timestamp: now.Unix(), }, }, } - return points, err + return points, nil } // 连接成功,关闭连接 defer conn.Close() @@ -37,7 +37,7 @@ func EndpointPortEval(_ context.Context, endpoint string, port uint32, timeout t Labels: labels.Map(), Values: []*Value{ { - Value: 1, + Value: 0, Timestamp: now.Unix(), }, },