Documentation
¶
Index ¶
- Variables
- func DeleteStaleAgents()
- func GetBuiltinMetrics(hostname string) ([]*model.BuiltinMetric, error)
- func GetPlugins(hostname string) []string
- func Init()
- func JudgeHostMaintain(hostname string) bool
- func JudgeHostPlugin(hostname string) []string
- func JudgeHostSpecialMetric(hostname string) []*model.BuiltinMetric
- func JudgeHostStrategies(hostname string) []*model.Strategy
- func JudgeUnionStrategies(unionId int) []*model.Strategy
- func ParentIds(allTpls map[int]*model.Template, tid int) (ret []int)
- type SafeAgents
- func (this *SafeAgents) AgentVersions() map[string]string
- func (this *SafeAgents) AgentVersionsNew() map[string]string
- func (this *SafeAgents) Delete(hostname string)
- func (this *SafeAgents) Get(hostname string) (*model.AgentUpdateInfo, bool)
- func (this *SafeAgents) Keys() []string
- func (this *SafeAgents) Put(req *model.AgentReportRequest)
- type SafeDynamicConfig
- type SafeExpressionCache
- type SafeGroupPlugins
- type SafeGroupTemplates
- type SafeHostGroupsMap
- type SafeHostMap
- type SafeHostTemplateIds
- type SafeMonitoredHosts
- type SafeServices
- type SafeStrategies
- type SafeTemplateCache
- type SafeUnionStrategies
- type UpgradeAgent
- type UpgradeAgents
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HostMaintainCache = cache.New(g.GlobalCacheTtl, g.GlobalCacheTtl) HostSSCache = cache.New(g.GlobalCacheTtl, g.GlobalCacheTtl) UnionStrategiesCache = cache.New(g.GlobalCacheTtl, g.GlobalCacheTtl) HostSpecialMetricCache = cache.New(g.GlobalCacheTtl, g.GlobalCacheTtl) HostPluginCache = cache.New(g.GlobalCacheTtl, g.GlobalCacheTtl) )
View Source
var ( Strategies = &SafeStrategies{M: make(map[int]*model.Strategy)} UnionStrategies = &SafeUnionStrategies{M: make(map[int][]*model.Strategy)} )
View Source
var Agents = NewSafeAgents()
View Source
var DynamicConfig = &SafeDynamicConfig{M: make(map[string][]*model.DynamicConfig)}
View Source
var ExpressionCache = &SafeExpressionCache{}
View Source
var GroupPlugins = &SafeGroupPlugins{M: make(map[int][]string)}
View Source
var GroupTemplates = &SafeGroupTemplates{M: make(map[int][]int)}
View Source
var HostGroupsMap = &SafeHostGroupsMap{M: make(map[int][]int)}
View Source
var HostMap = &SafeHostMap{M: make(map[string]int)}
View Source
var HostTemplateIds = &SafeHostTemplateIds{M: make(map[int][]int)}
View Source
var MonitoredHosts = &SafeMonitoredHosts{M: make(map[int]*model.Host)}
View Source
var NewAgentUpgradeArgs = &model.AgentUpgradeArgs{WgetUrl: "", Version: ""}
View Source
var NowAgentVersionMap = sync.Map{}
View Source
var Services = &SafeServices{M: make(map[string]string)}
View Source
var TemplateCache = &SafeTemplateCache{M: make(map[int]*model.Template)}
Functions ¶
func DeleteStaleAgents ¶
func DeleteStaleAgents()
func GetBuiltinMetrics ¶
func GetBuiltinMetrics(hostname string) ([]*model.BuiltinMetric, error)
func JudgeHostMaintain ¶
func JudgeHostPlugin ¶
func JudgeHostSpecialMetric ¶
func JudgeHostSpecialMetric(hostname string) []*model.BuiltinMetric
func JudgeHostStrategies ¶
func JudgeUnionStrategies ¶
Types ¶
type SafeAgents ¶
type SafeAgents struct { sync.RWMutex M map[string]*model.AgentUpdateInfo }
func NewSafeAgents ¶
func NewSafeAgents() *SafeAgents
func (*SafeAgents) AgentVersions ¶
func (this *SafeAgents) AgentVersions() map[string]string
func (*SafeAgents) AgentVersionsNew ¶
func (this *SafeAgents) AgentVersionsNew() map[string]string
func (*SafeAgents) Delete ¶
func (this *SafeAgents) Delete(hostname string)
func (*SafeAgents) Get ¶
func (this *SafeAgents) Get(hostname string) (*model.AgentUpdateInfo, bool)
func (*SafeAgents) Keys ¶
func (this *SafeAgents) Keys() []string
func (*SafeAgents) Put ¶
func (this *SafeAgents) Put(req *model.AgentReportRequest)
type SafeDynamicConfig ¶
type SafeDynamicConfig struct { sync.RWMutex M map[string][]*model.DynamicConfig }
func (*SafeDynamicConfig) Get ¶
func (this *SafeDynamicConfig) Get() map[string][]*model.DynamicConfig
func (*SafeDynamicConfig) Init ¶
func (this *SafeDynamicConfig) Init()
type SafeExpressionCache ¶
type SafeExpressionCache struct { sync.RWMutex L []*model.Expression }
func (*SafeExpressionCache) Get ¶
func (this *SafeExpressionCache) Get() []*model.Expression
func (*SafeExpressionCache) Init ¶
func (this *SafeExpressionCache) Init()
type SafeGroupPlugins ¶
一个HostGroup可以绑定多个Plugin
func (*SafeGroupPlugins) GetPlugins ¶
func (this *SafeGroupPlugins) GetPlugins(gid int) ([]string, bool)
func (*SafeGroupPlugins) Init ¶
func (this *SafeGroupPlugins) Init()
type SafeGroupTemplates ¶
一个HostGroup对应多个Template
func (*SafeGroupTemplates) GetTemplateIds ¶
func (this *SafeGroupTemplates) GetTemplateIds(gid int) ([]int, bool)
func (*SafeGroupTemplates) Init ¶
func (this *SafeGroupTemplates) Init()
type SafeHostGroupsMap ¶
一个机器可能在多个group下,做一个map缓存hostid与groupid的对应关系
func (*SafeHostGroupsMap) GetGroupIds ¶
func (this *SafeHostGroupsMap) GetGroupIds(hid int) ([]int, bool)
func (*SafeHostGroupsMap) Init ¶
func (this *SafeHostGroupsMap) Init()
type SafeHostMap ¶
每次心跳的时候agent把hostname汇报上来,经常要知道这个机器的hostid,把此信息缓存 key: hostname value: hostid
func (*SafeHostMap) Get ¶
func (this *SafeHostMap) Get() map[string]int
func (*SafeHostMap) Init ¶
func (this *SafeHostMap) Init()
type SafeHostTemplateIds ¶
func (*SafeHostTemplateIds) GetMap ¶
func (this *SafeHostTemplateIds) GetMap() map[int][]int
func (*SafeHostTemplateIds) Init ¶
func (this *SafeHostTemplateIds) Init()
type SafeMonitoredHosts ¶
func (*SafeMonitoredHosts) Init ¶
func (this *SafeMonitoredHosts) Init()
type SafeServices ¶
一个机器可能在多个group下,做一个map缓存hostid与groupid的对应关系
func (*SafeServices) Get ¶
func (this *SafeServices) Get() map[string]string
type SafeStrategies ¶
type SafeTemplateCache ¶
func (*SafeTemplateCache) Init ¶
func (this *SafeTemplateCache) Init()
type SafeUnionStrategies ¶
type UpgradeAgent ¶
type UpgradeAgents ¶
func NewUpgradeAgents ¶
func NewUpgradeAgents() *UpgradeAgents
func (*UpgradeAgents) UpgradeAgentKeys ¶
func (this *UpgradeAgents) UpgradeAgentKeys() (len int, keys []string)
Click to show internal directories.
Click to hide internal directories.