Documentation ¶
Index ¶
- Variables
- func GetAlarmLevel(k AlarmLevel) string
- func GetAlarmLevelMap() map[AlarmLevel]string
- func GetLocalNotifyChannel() []map[string]string
- func GetLocalNotifyName(id string) string
- func GetMetricName(id string) string
- func GetMetricUnit(id string) string
- func GetNotifyChannel() []map[string]string
- func GetNotifyName(id string) string
- type AlarmContact
- type AlarmLevel
- type AlarmRule
- func (r AlarmRule) Delete(selector interface{}) error
- func (r AlarmRule) Query() (result []int, err error)
- func (r AlarmRule) QueryList(c *gin.Context, team int) (pagination.HTTPResponse, error)
- func (r AlarmRule) QueryMany(q interface{}) (result []AlarmRule, err error)
- func (r AlarmRule) QueryTaskRules(taskID string) (result []AlarmRule, err error)
- func (r AlarmRule) Save() (int, error)
- func (r AlarmRule) TableName() string
- type AlarmTask
- type Metric
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AlarmMetricList []map[string]string
)
Functions ¶
func GetAlarmLevel ¶
func GetAlarmLevel(k AlarmLevel) string
func GetAlarmLevelMap ¶
func GetAlarmLevelMap() map[AlarmLevel]string
func GetLocalNotifyChannel ¶
func GetLocalNotifyName ¶
func GetMetricName ¶
func GetMetricUnit ¶
func GetNotifyChannel ¶
func GetNotifyName ¶
Types ¶
type AlarmContact ¶
type AlarmContact struct { ID int `json:"id"` // ID Username string `json:"username"` // 用户名 Nickname string `json:"nickname"` // 姓名 Password string `json:"password"` // 密码 Channel string `json:"channel" binding:"required"` // 通道 Email string `json:"email"` // 邮箱 Phone string `json:"phone"` // 手机号 IsActive bool `json:"is_active" bson:"is_active"` // 是否活动 IsSuperuser bool `json:"is_superuser" bson:"is_superuser"` // 是否超级管理员 Role string `json:"role"` // 用户角色; admin OR user Group string `json:"group"` // 用户组 DingDing string `json:"dingding"` // dingding Feishu string `json:"feishu"` // feishu WebHook string `json:"webhook"` // WebHook LastLogin time.Time `json:"last_login" bson:"last_login"` // 登录时间 CreateTime time.Time `json:"create_time" bson:"create_time"` // 创建时间 }
AlarmContact 联系人
func (AlarmContact) NotifyContact ¶
func (t AlarmContact) NotifyContact() ([]types.Menu, error)
NotifyContact
func (AlarmContact) QueryList ¶
func (t AlarmContact) QueryList(c *gin.Context) (pagination.HTTPResponse, error)
QueryList 列表
type AlarmRule ¶
type AlarmRule struct { types.Currency `bson:"-"` ID int `json:"id"` // ID Team int `json:"team"` // 团队ID Name string `json:"name"` // 规则名称 Task types.Model `json:"task"` // 关联任务 State bool `json:"state"` // 是否开启 Status string `json:"status"` // 运行状态 Notify []int `json:"notify"` // 通知对象 Condition string `json:"condition"` // 规则条件 Metric string `json:"metric"` // 指标名称 Alarm []types.Alarm `json:"alarm"` // 报警详情 CreateTime time.Time `json:"create_time" bson:"create_time"` // 创建时间 }
AlarmRule 报警规则
func (AlarmRule) QueryList ¶
func (r AlarmRule) QueryList(c *gin.Context, team int) (pagination.HTTPResponse, error)
QueryList 列表
func (AlarmRule) QueryTaskRules ¶
QueryTaskRules 查询
type AlarmTask ¶
type AlarmTask struct { ID int `json:"id"` // ID TaskName string `json:"task_name" bson:"task_name"` // 任务名称 TaskID string `json:"task_id" bson:"task_id"` // 任务ID RuleID int `json:"rule_id" bson:"rule_id"` // 规则ID Users []types.Users `json:"users" bson:"users"` // 通知用户 NodeID int `json:"node_id" bson:"node_id"` // 节点ID Team int `json:"team"` // 团队ID Level string `json:"level"` // 级别 Title string `json:"title"` // 标题 CurValue float64 `json:"cur_value" bson:"cur_value"` // 当前值 Threshold string `json:"threshold"` // 报警阀值 Unit string `json:"unit"` // 阀值单位 Metric string `json:"metric"` // 指标名称 Status string `json:"status"` // 报警状态;trigger OR recovery Counter int `json:"counter"` // 计数器 Archive bool `json:"archive"` // 是否归档 ArchiveTime time.Time `json:"archive_time" bson:"archive_time"` // 归档时间 RecoveryTime time.Time `json:"recovery_time" bson:"recovery_time"` // 恢复时间 CreateTime time.Time `json:"create_time" bson:"create_time"` // 报警时间 }
AlarmTask 报警表
func (AlarmTask) QueryList ¶
func (t AlarmTask) QueryList(c *gin.Context) (pagination.HTTPResponse, error)
QueryList 列表
Click to show internal directories.
Click to hide internal directories.