feat: v0.34 健康探针(Architecture B) + Agent v2.1 + 端口监控 + 告警联系人重构
- v0.31: AlertContact 重构(channel_type下拉+webhook_url替代三分立字段) - v0.32: Agent ProcessTop 增强(cmdline/user/cpu_pct/mem_pct) - v0.33: 端口监控 Tab(监听端口自动发现+down联动告警) - v0.34: 健康探针(Agent本地执行HTTP/TCP/Exec→结果随心跳上报) - Agent新增: ContextSwitch/FD/HealthProbe采集器 - 后端新增: health_probe handler + Agent model扩展 - HostMonitor新增Tab: 健康探针/端口监控
This commit is contained in:
1 parent
e1f75f0bc4
commit
d656520428
25 files changed
+1700
-619
No files matched your search
@@ -400,16 +400,15 @@ type AcknowledgeAlertRequest struct {
|
||||
// ============================================
|
||||
|
||||
type AlertContact struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement;comment:主键ID" json:"id"`
|
||||
Name string `gorm:"type:varchar(128);not null;comment:联系人姓名" json:"name"`
|
||||
Phone string `gorm:"type:varchar(32);comment:手机号" json:"phone,omitempty"`
|
||||
Email string `gorm:"type:varchar(128);comment:邮箱" json:"email,omitempty"`
|
||||
Dingtalk string `gorm:"type:varchar(256);comment:钉钉webhook地址" json:"dingtalk,omitempty"`
|
||||
Feishu string `gorm:"type:varchar(256);comment:飞书webhook地址" json:"feishu,omitempty"`
|
||||
Wechat string `gorm:"type:varchar(256);comment:企业微信webhook地址" json:"wechat,omitempty"`
|
||||
CreatedAt time.Time `gorm:"not null;comment:创建时间" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"not null;comment:更新时间" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"deleted_at,omitempty"`
|
||||
ID uint `gorm:"primaryKey;autoIncrement;comment:主键ID" json:"id"`
|
||||
Name string `gorm:"type:varchar(128);not null;comment:联系人姓名" json:"name"`
|
||||
Phone string `gorm:"type:varchar(32);comment:手机号" json:"phone,omitempty"`
|
||||
Email string `gorm:"type:varchar(128);comment:邮箱" json:"email,omitempty"`
|
||||
ChannelType string `gorm:"type:varchar(32);default:'feishu';comment:渠道类型: feishu/dingtalk/wechat/webhook" json:"channel_type,omitempty"`
|
||||
WebhookURL string `gorm:"type:varchar(512);comment:Webhook地址" json:"webhook_url,omitempty"`
|
||||
CreatedAt time.Time `gorm:"not null;comment:创建时间" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"not null;comment:更新时间" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间" json:"deleted_at,omitempty"`
|
||||
}
|
||||
|
||||
func (AlertContact) TableName() string {
|
||||
@@ -436,22 +435,20 @@ func (AlertContactGroup) TableName() string {
|
||||
|
||||
// CreateContactRequest 创建联系人请求
|
||||
type CreateContactRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Dingtalk string `json:"dingtalk,omitempty"`
|
||||
Feishu string `json:"feishu,omitempty"`
|
||||
Wechat string `json:"wechat,omitempty"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
ChannelType string `json:"channel_type" binding:"required,oneof=feishu dingtalk wechat webhook"`
|
||||
WebhookURL string `json:"webhook_url" binding:"required"`
|
||||
}
|
||||
|
||||
// UpdateContactRequest 更新联系人请求
|
||||
type UpdateContactRequest struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Dingtalk string `json:"dingtalk,omitempty"`
|
||||
Feishu string `json:"feishu,omitempty"`
|
||||
Wechat string `json:"wechat,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
ChannelType string `json:"channel_type,omitempty" binding:"omitempty,oneof=feishu dingtalk wechat webhook"`
|
||||
WebhookURL string `json:"webhook_url,omitempty"`
|
||||
}
|
||||
|
||||
// CreateContactGroupRequest 创建联系组请求
|
||||
|
||||
Reference in new issue
Block a user