Documentation ¶
Index ¶
- func DigestBuiltinMetrics(items []BuiltinMetric) string
- func UpdateAgent(agentInfo *AgentUpdateInfo)
- type AgentHeartbeatRequest
- type AgentPluginsResponse
- type AgentReportRequest
- type AgentUpdateInfo
- type BuiltinMetric
- type BuiltinMetricResponse
- type BuiltinMetricSlice
- type Expression
- type ExpressionResponse
- type GroupTemplate
- type Host
- type HostGroup
- type HostStrategy
- type HostTemplate
- type NullRpcRequest
- type Plugin
- type SimpleRpcResponse
- type StrategiesResponse
- type Strategy
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DigestBuiltinMetrics ¶
func DigestBuiltinMetrics(items []BuiltinMetric) string
func UpdateAgent ¶
func UpdateAgent(agentInfo *AgentUpdateInfo)
Types ¶
type AgentHeartbeatRequest ¶
func (*AgentHeartbeatRequest) String ¶
func (u *AgentHeartbeatRequest) String() string
type AgentPluginsResponse ¶
func (*AgentPluginsResponse) String ¶
func (u *AgentPluginsResponse) String() string
type AgentReportRequest ¶
type AgentReportRequest struct { Hostname string IP string AgentVersion string PluginVersion string }
func (*AgentReportRequest) String ¶
func (u *AgentReportRequest) String() string
type AgentUpdateInfo ¶
type AgentUpdateInfo struct { LastUpdate int64 ReportRequest *AgentReportRequest }
type BuiltinMetric ¶
func (*BuiltinMetric) String ¶
func (u *BuiltinMetric) String() string
type BuiltinMetricResponse ¶
type BuiltinMetricResponse struct { Metrics []BuiltinMetric Checksum string Timestamp int64 }
func (*BuiltinMetricResponse) String ¶
func (u *BuiltinMetricResponse) String() string
type BuiltinMetricSlice ¶
type BuiltinMetricSlice []BuiltinMetric
func (BuiltinMetricSlice) Len ¶
func (u BuiltinMetricSlice) Len() int
func (BuiltinMetricSlice) Less ¶
func (u BuiltinMetricSlice) Less(i, j int) bool
func (BuiltinMetricSlice) Swap ¶
func (u BuiltinMetricSlice) Swap(i, j int)
type Expression ¶
type Expression struct { ID int64 `gorm:"primary_key" json:"id"` Expression string `gorm:"type:varchar(1024)" json:"expression" comment:"表达式"` Func string `gorm:"type:varchar(16);default:all(#1)" json:"func" comment:"max(#3) all(#3)"` Op string `gorm:"type:varchar(8)" json:"op" comment:"条件"` RightValue string `gorm:"column:right_value;type:varchar(16)" json:"right_value" comment:"报警阈值"` MaxStep int64 `gorm:"default:1" json:"max_step" comment:"间隔时间"` Priority int `gorm:"default:0" json:"priority" comment:"问题级别"` ActionId int64 `gorm:"default:0" json:"action_id" comment:"动作id"` CreateUser string `gorm:"column:create_user;type:varchar(64)" json:"create_user" comment:"创建用户"` Pause int `gorm:"default:0" json:"pause" comment:"停用"` Note string `gorm:"type:longtext" json:"note" comment:"备注"` Metric string `gorm:"-" json:"metric"` Tags map[string]string `gorm:"-" json:"tags"` }
func (Expression) GetAll ¶
func (u Expression) GetAll() ([]Expression, error)
func (*Expression) ParseExpression ¶
func (u *Expression) ParseExpression() (string, map[string]string, error)
func (Expression) TableName ¶
func (Expression) TableName() string
type ExpressionResponse ¶
type ExpressionResponse struct {
Expressions []Expression `json:"expressions"`
}
type GroupTemplate ¶
type GroupTemplate struct { ID int64 `gorm:"primary_key" json:"id"` TplId int64 `gorm:"column:tpl_id;" json:"tpl_id" comment:"模版id"` GrpId int64 `gorm:"column:grp_id;" json:"grp_id" comment:"机器组id"` BindUser string `gorm:"column:bind_user;type:varchar(64)" json:"bind_user" comment:"绑定用户"` }
func (GroupTemplate) GetAll ¶
func (u GroupTemplate) GetAll() ([]GroupTemplate, error)
func (GroupTemplate) TableName ¶
func (GroupTemplate) TableName() string
type Host ¶
type Host struct { ID int64 `gorm:"primary_key" json:"id"` Hostname string `gorm:"column:hostname;type:varchar(255)" json:"hostname" comment:"主机名"` Ip string `gorm:"type:varchar(16)" json:"ip" comment:"主机ip"` AgentVersion string `gorm:"column:agent_version;type:varchar(16)" json:"agent_version" comment:"agent版本"` PluginVersion string `gorm:"column:plugin_version;type:varchar(128)" json:"plugin_version" comment:"插件版本"` MaintainBegin int64 `gorm:"column:maintain_begin;default:0" json:"maintain_begin" comment:"维护开始时间"` MaintainEnd int64 `gorm:"column:maintain_end;default:0" json:"maintain_end" comment:"维护结束时间"` UpdateAt time.Time `gorm:"column:update_at" json:"update_at" comment:"更新时间"` }
func (Host) GetHostNotInMaintain ¶
type HostGroup ¶
type HostStrategy ¶
type HostTemplate ¶
type HostTemplate struct { HostId int64 `gorm:"column:host_id;" json:"host_id" comment:"主机id"` TplId int64 `gorm:"column:tpl_id;" json:"tpl_id" comment:"模版id"` }
func (HostTemplate) GetAll ¶
func (u HostTemplate) GetAll() ([]HostTemplate, error)
type NullRpcRequest ¶
type NullRpcRequest struct { }
type Plugin ¶
type Plugin struct { ID int64 `gorm:"primary_key" json:"id"` GrpId int64 `gorm:"column:grp_id;" json:"grp_id" comment:"机器组id"` Dir string `gorm:"type:varchar(255)" json:"dir" comment:"目录名称"` CreateUser string `gorm:"column:create_user;type:varchar(64)" json:"create_user" comment:"创建用户"` CreatedAt time.Time `gorm:"column:create_at" json:"create_at" comment:"创建时间"` }
type SimpleRpcResponse ¶
type SimpleRpcResponse struct {
Code int `json:"code"`
}
func (*SimpleRpcResponse) String ¶
func (u *SimpleRpcResponse) String() string
type StrategiesResponse ¶
type StrategiesResponse struct {
HostStrategies []HostStrategy `json:"hostStrategies"`
}
type Strategy ¶
type Strategy struct { ID int64 `gorm:"primary_key" json:"id"` Func string `gorm:"type:varchar(16);default:all(#1)" json:"func" comment:"max(#3) all(#3)"` Op string `gorm:"type:varchar(8)" json:"op" comment:"条件"` RightValue string `gorm:"column:right_value;type:varchar(16)" json:"right_value" comment:"报警阈值"` MaxStep int64 `gorm:"default:1" json:"max_step" comment:"间隔时间"` Priority int `gorm:"default:0" json:"priority" comment:"问题级别"` Note string `gorm:"type:longtext" json:"note" comment:"备注"` Metric string `gorm:"type:varchar(128)" json:"metric"` Tags string `gorm:"type:varchar(256)" json:"tags"` RunBegin string `gorm:"column:run_begin;type:varchar(16)" json:"run_begin" comment:"运行开始"` RunEnd string `gorm:"column:run_end;type:varchar(16)" json:"run_end" comment:"运行结束"` TplId int64 `gorm:"column:tpl_id;" json:"tpl_id" comment:"模版id"` }
func (Strategy) GetBuiltinMetrics ¶
func (u Strategy) GetBuiltinMetrics(templateIds string) ([]BuiltinMetric, error)
type Template ¶
type Template struct { ID int64 `gorm:"primary_key" json:"id"` ParentId int64 `gorm:"column:parent_id;" json:"parent_id" comment:"父模版id"` ActionId int64 `gorm:"column:action_id;" json:"action_id" comment:"动作id"` TplName string `gorm:"column:tpl_name;type:varchar(255)" json:"tpl_name" comment:"模版名称"` CreateUser string `gorm:"column:create_user;type:varchar(64)" json:"create_user" comment:"创建用户"` CreatedAt time.Time `gorm:"column:create_at" json:"create_at" comment:"创建时间"` }
Click to show internal directories.
Click to hide internal directories.