Documentation ¶
Index ¶
- Constants
- Variables
- func AllActions() []maps.Map
- func AllDataSources() []maps.Map
- func AllSourceDataFormats() []maps.Map
- func AllThresholdOperators() []maps.Map
- func ConvertSourceToMap(source SourceInterface) map[string]interface{}
- func DecodeSource(data []byte, format SourceDataFormat) (value interface{}, err error)
- func EvalParam(param string, value interface{}, old interface{}, varMapping maps.Map, ...) (string, error)
- func FindAction(code string) maps.Map
- func FindDataSource(code string) maps.Map
- func FindSourceDataFormat(dataFormat SourceDataFormat) maps.Map
- func FindThresholdOperator(op string) maps.Map
- func FuncAppend(args ...interface{}) interface{}
- func FuncCeil(args ...interface{}) interface{}
- func FuncFloat(args ...interface{}) interface{}
- func FuncFloor(args ...interface{}) interface{}
- func FuncFormat(args ...interface{}) interface{}
- func FuncRound(args ...interface{}) interface{}
- func NotifyAgentsChange()
- func RegisterAllDataSources()
- func RegisterDataSource(dataSource SourceInterface, category SourceCategory)
- func RegisterFunc(code string, f interface{})
- func RunFuncExpr(value interface{}, expr []byte) (interface{}, error)
- type ActionInterface
- type AgentConfig
- func (this *AgentConfig) AddApp(app *AppConfig)
- func (this *AgentConfig) AddApps(apps []*AppConfig)
- func (this *AgentConfig) AddDefaultApps()
- func (this *AgentConfig) AddGroup(groupId string)
- func (this *AgentConfig) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
- func (this *AgentConfig) BelongsToGroup(groupId string) bool
- func (this *AgentConfig) BelongsToGroups(groupIds []string) bool
- func (this *AgentConfig) CountNoticeReceivers() int
- func (this *AgentConfig) Delete() error
- func (this *AgentConfig) EncodeYAML() ([]byte, error)
- func (this *AgentConfig) Filename() string
- func (this *AgentConfig) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
- func (this *AgentConfig) FindApp(appId string) *AppConfig
- func (this *AgentConfig) FindItem(itemId string) (appConfig *AppConfig, item *Item)
- func (this *AgentConfig) FindTask(taskId string) (appConfig *AppConfig, taskConfig *TaskConfig)
- func (this *AgentConfig) FirstGroup() *Group
- func (this *AgentConfig) GroupName() string
- func (this *AgentConfig) HasApp(appId string) bool
- func (this *AgentConfig) IsLocal() bool
- func (this *AgentConfig) MatchKeyword(keyword string) (matched bool, name string, tags []string)
- func (this *AgentConfig) MoveApp(fromIndex int, toIndex int)
- func (this *AgentConfig) RemoveApp(appId string)
- func (this *AgentConfig) RemoveGroup(groupId string)
- func (this *AgentConfig) RemoveMedia(mediaId string) (found bool)
- func (this *AgentConfig) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
- func (this *AgentConfig) ReplaceApp(app *AppConfig)
- func (this *AgentConfig) Save() error
- func (this *AgentConfig) Validate() error
- type AgentList
- func (this *AgentList) AddAgent(agentFile string)
- func (this *AgentList) CountAgentsInGroup(groupId string) int
- func (this *AgentList) FindAllAgents() []*AgentConfig
- func (this *AgentList) MoveAgent(fromId string, toId string)
- func (this *AgentList) RemoveAgent(agentFile string)
- func (this *AgentList) Save() error
- type AppConfig
- func (this *AppConfig) AddItem(item *Item)
- func (this *AppConfig) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
- func (this *AppConfig) AddTask(task *TaskConfig)
- func (this *AppConfig) CountNoticeReceivers() int
- func (this *AppConfig) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
- func (this *AppConfig) FindBootingTasks() []*TaskConfig
- func (this *AppConfig) FindItem(itemId string) *Item
- func (this *AppConfig) FindManualTasks() []*TaskConfig
- func (this *AppConfig) FindSchedulingTasks() []*TaskConfig
- func (this *AppConfig) FindTask(taskId string) *TaskConfig
- func (this *AppConfig) MatchKeyword(keyword string) (matched bool, name string, tags []string)
- func (this *AppConfig) RemoveItem(itemId string)
- func (this *AppConfig) RemoveMedia(mediaId string) (found bool)
- func (this *AppConfig) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
- func (this *AppConfig) RemoveTask(taskId string)
- func (this *AppConfig) Validate() error
- type AppProcessesSource
- func (this *AppProcessesSource) Charts() []*widgets.Chart
- func (this *AppProcessesSource) Code() string
- func (this *AppProcessesSource) Description() string
- func (this *AppProcessesSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *AppProcessesSource) Form() *forms.Form
- func (this *AppProcessesSource) Name() string
- func (this *AppProcessesSource) Platforms() []string
- func (this *AppProcessesSource) Presentation() *forms.Presentation
- func (this *AppProcessesSource) Thresholds() []*Threshold
- func (this *AppProcessesSource) Variables() []*SourceVariable
- type Board
- func (this *Board) AddChart(appId, itemId, chartId string)
- func (this *Board) FindChart(chartId string) *BoardChart
- func (this *Board) HasChart(chartId string) bool
- func (this *Board) MoveChart(fromIndex int, toIndex int)
- func (this *Board) RemoveApp(appId string)
- func (this *Board) RemoveChart(chartId string)
- func (this *Board) Save() error
- type BoardChart
- type CPUSource
- func (this *CPUSource) Charts() []*widgets.Chart
- func (this *CPUSource) Code() string
- func (this *CPUSource) Description() string
- func (this *CPUSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *CPUSource) Form() *forms.Form
- func (this *CPUSource) Name() string
- func (this *CPUSource) Thresholds() []*Threshold
- func (this *CPUSource) Variables() []*SourceVariable
- type ConnectionsSource
- func (this *ConnectionsSource) Charts() []*widgets.Chart
- func (this *ConnectionsSource) Code() string
- func (this *ConnectionsSource) Description() string
- func (this *ConnectionsSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *ConnectionsSource) Form() *forms.Form
- func (this *ConnectionsSource) Name() string
- func (this *ConnectionsSource) Presentation() *forms.Presentation
- func (this *ConnectionsSource) Thresholds() []*Threshold
- func (this *ConnectionsSource) Variables() []*SourceVariable
- type DNSSource
- func (this *DNSSource) Charts() []*widgets.Chart
- func (this *DNSSource) Code() string
- func (this *DNSSource) Description() string
- func (this *DNSSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *DNSSource) Form() *forms.Form
- func (this *DNSSource) Name() string
- func (this *DNSSource) Presentation() *forms.Presentation
- func (this *DNSSource) Thresholds() []*Threshold
- func (this *DNSSource) Variables() []*SourceVariable
- type DateSource
- func (this *DateSource) Charts() []*widgets.Chart
- func (this *DateSource) Code() string
- func (this *DateSource) Description() string
- func (this *DateSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *DateSource) Form() *forms.Form
- func (this *DateSource) Name() string
- func (this *DateSource) Presentation() *forms.Presentation
- func (this *DateSource) Thresholds() []*Threshold
- func (this *DateSource) Variables() []*SourceVariable
- type DiskSource
- func (this *DiskSource) Charts() []*widgets.Chart
- func (this *DiskSource) Code() string
- func (this *DiskSource) Description() string
- func (this *DiskSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *DiskSource) Form() *forms.Form
- func (this *DiskSource) Name() string
- func (this *DiskSource) Presentation() *forms.Presentation
- func (this *DiskSource) Thresholds() []*Threshold
- func (this *DiskSource) Variables() []*SourceVariable
- type DockerSource
- func (this *DockerSource) Charts() []*widgets.Chart
- func (this *DockerSource) Code() string
- func (this *DockerSource) Description() string
- func (this *DockerSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *DockerSource) Form() *forms.Form
- func (this *DockerSource) Name() string
- func (this *DockerSource) Thresholds() []*Threshold
- func (this *DockerSource) Variables() []*SourceVariable
- type FileChangeSource
- func (this *FileChangeSource) Charts() []*widgets.Chart
- func (this *FileChangeSource) Code() string
- func (this *FileChangeSource) Description() string
- func (this *FileChangeSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *FileChangeSource) Form() *forms.Form
- func (this *FileChangeSource) Name() string
- func (this *FileChangeSource) Presentation() *forms.Presentation
- func (this *FileChangeSource) Thresholds() []*Threshold
- func (this *FileChangeSource) Variables() []*SourceVariable
- type FileSource
- func (this *FileSource) Code() string
- func (this *FileSource) Description() string
- func (this *FileSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *FileSource) Form() *forms.Form
- func (this *FileSource) Name() string
- func (this *FileSource) Presentation() *forms.Presentation
- func (this *FileSource) Validate() error
- type Group
- func (this *Group) AddKey(key *GroupKey)
- func (this *Group) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
- func (this *Group) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
- func (this *Group) FindKey(key string) *GroupKey
- func (this *Group) GenerateKey() string
- func (this *Group) IsAvailable() bool
- func (this *Group) IsDateAvailable() bool
- func (this *Group) MatchKeyword(keyword string) (matched bool, name string, tags []string)
- func (this *Group) RemoveMedia(mediaId string) (found bool)
- func (this *Group) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
- func (this *Group) WriteToFile(path string) error
- type GroupKey
- type GroupList
- func (this *GroupList) AddGroup(group *Group)
- func (this *GroupList) BuildIndexes() error
- func (this *GroupList) FindAllGroups() []*Group
- func (this *GroupList) FindDefaultGroup() *Group
- func (this *GroupList) FindGroup(groupId string) *Group
- func (this *GroupList) FindGroupWithKey(key string) *Group
- func (this *GroupList) Move(fromIndex int, toIndex int)
- func (this *GroupList) RemoveGroup(groupId string)
- func (this *GroupList) Save() error
- type IOStatSource
- func (this *IOStatSource) Charts() []*widgets.Chart
- func (this *IOStatSource) Code() string
- func (this *IOStatSource) Description() string
- func (this *IOStatSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *IOStatSource) Form() *forms.Form
- func (this *IOStatSource) Name() string
- func (this *IOStatSource) Thresholds() []*Threshold
- func (this *IOStatSource) Variables() []*SourceVariable
- type Item
- func (this *Item) AddChart(chart *widgets.Chart)
- func (this *Item) AddFilterCharts(charts []*widgets.Chart, chartId ...string)
- func (this *Item) AddThreshold(t ...*Threshold)
- func (this *Item) FindChart(chartId string) *widgets.Chart
- func (this *Item) IntervalDuration() time.Duration
- func (this *Item) MatchKeyword(keyword string) (matched bool, name string, tags []string)
- func (this *Item) RemoveChart(chartId string)
- func (this *Item) Source() SourceInterface
- func (this *Item) TestValue(value interface{}, oldValue interface{}) (threshold *Threshold, row interface{}, level notices.NoticeLevel, ...)
- func (this *Item) Validate() error
- type LoadSource
- func (this *LoadSource) Charts() []*widgets.Chart
- func (this *LoadSource) Code() string
- func (this *LoadSource) Description() string
- func (this *LoadSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *LoadSource) Form() *forms.Form
- func (this *LoadSource) Name() string
- func (this *LoadSource) Thresholds() []*Threshold
- func (this *LoadSource) Variables() []*SourceVariable
- type MemorySource
- func (this *MemorySource) Charts() []*widgets.Chart
- func (this *MemorySource) Code() string
- func (this *MemorySource) Description() string
- func (this *MemorySource) Execute(params map[string]string) (value interface{}, err error)
- func (this *MemorySource) Form() *forms.Form
- func (this *MemorySource) Name() string
- func (this *MemorySource) Thresholds() []*Threshold
- func (this *MemorySource) Variables() []*SourceVariable
- type MySQLSource
- func (this *MySQLSource) Charts() []*widgets.Chart
- func (this *MySQLSource) Code() string
- func (this *MySQLSource) Description() string
- func (this *MySQLSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *MySQLSource) Form() *forms.Form
- func (this *MySQLSource) Name() string
- func (this *MySQLSource) Presentation() *forms.Presentation
- func (this *MySQLSource) Stop() error
- func (this *MySQLSource) Thresholds() []*Threshold
- func (this *MySQLSource) Variables() []*SourceVariable
- type NetworkSource
- func (this *NetworkSource) Charts() []*widgets.Chart
- func (this *NetworkSource) Code() string
- func (this *NetworkSource) Description() string
- func (this *NetworkSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *NetworkSource) Form() *forms.Form
- func (this *NetworkSource) Name() string
- func (this *NetworkSource) Presentation() *forms.Presentation
- func (this *NetworkSource) Thresholds() []*Threshold
- func (this *NetworkSource) Variables() []*SourceVariable
- type NginxStatusSource
- func (this *NginxStatusSource) Charts() []*widgets.Chart
- func (this *NginxStatusSource) Code() string
- func (this *NginxStatusSource) Description() string
- func (this *NginxStatusSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *NginxStatusSource) Form() *forms.Form
- func (this *NginxStatusSource) Name() string
- func (this *NginxStatusSource) Presentation() *forms.Presentation
- func (this *NginxStatusSource) Thresholds() []*Threshold
- func (this *NginxStatusSource) Validate() error
- func (this *NginxStatusSource) Variables() []*SourceVariable
- type PingSource
- func (this *PingSource) Charts() []*widgets.Chart
- func (this *PingSource) Code() string
- func (this *PingSource) Description() string
- func (this *PingSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *PingSource) Form() *forms.Form
- func (this *PingSource) Name() string
- func (this *PingSource) Presentation() *forms.Presentation
- func (this *PingSource) Thresholds() []*Threshold
- func (this *PingSource) Variables() []*SourceVariable
- type PostgreSQLSource
- func (this *PostgreSQLSource) Charts() []*widgets.Chart
- func (this *PostgreSQLSource) Code() string
- func (this *PostgreSQLSource) Description() string
- func (this *PostgreSQLSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *PostgreSQLSource) Form() *forms.Form
- func (this *PostgreSQLSource) Name() string
- func (this *PostgreSQLSource) Presentation() *forms.Presentation
- func (this *PostgreSQLSource) Stop() error
- func (this *PostgreSQLSource) Thresholds() []*Threshold
- func (this *PostgreSQLSource) Variables() []*SourceVariable
- type ProcessLog
- type ProcessesSource
- func (this *ProcessesSource) Charts() []*widgets.Chart
- func (this *ProcessesSource) Code() string
- func (this *ProcessesSource) Description() string
- func (this *ProcessesSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *ProcessesSource) Form() *forms.Form
- func (this *ProcessesSource) Name() string
- func (this *ProcessesSource) Presentation() *forms.Presentation
- func (this *ProcessesSource) Thresholds() []*Threshold
- func (this *ProcessesSource) Variables() []*SourceVariable
- type ScheduleConfig
- func (this *ScheduleConfig) AddDayRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddHourRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddMinuteRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddMonthRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddSecondRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddWeekDayRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) AddYearRanges(r ...*ScheduleRangeConfig)
- func (this *ScheduleConfig) Next(now time.Time) (t time.Time, ok bool)
- func (this *ScheduleConfig) ShouldRun(t time.Time) bool
- func (this *ScheduleConfig) Summary() string
- func (this *ScheduleConfig) Validate() error
- type ScheduleRangeConfig
- type ScheduleRangeList
- type ScriptAction
- func (this *ScriptAction) AddEnv(name, value string)
- func (this *ScriptAction) Code() string
- func (this *ScriptAction) Description() string
- func (this *ScriptAction) FormattedScript() string
- func (this *ScriptAction) Generate(id string) (path string, err error)
- func (this *ScriptAction) Name() string
- func (this *ScriptAction) Run(params map[string]string) (result string, err error)
- func (this *ScriptAction) Summary() maps.Map
- func (this *ScriptAction) Validate() error
- type ScriptSource
- func (this *ScriptSource) AddEnv(name, value string)
- func (this *ScriptSource) Code() string
- func (this *ScriptSource) Description() string
- func (this *ScriptSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *ScriptSource) Form() *forms.Form
- func (this *ScriptSource) FormattedScript() string
- func (this *ScriptSource) Generate(id string) (path string, err error)
- func (this *ScriptSource) Name() string
- func (this *ScriptSource) Presentation() *forms.Presentation
- func (this *ScriptSource) Validate() error
- type SocketConnectivitySource
- func (this *SocketConnectivitySource) Charts() []*widgets.Chart
- func (this *SocketConnectivitySource) Code() string
- func (this *SocketConnectivitySource) Description() string
- func (this *SocketConnectivitySource) Execute(params map[string]string) (value interface{}, err error)
- func (this *SocketConnectivitySource) Form() *forms.Form
- func (this *SocketConnectivitySource) Name() string
- func (this *SocketConnectivitySource) Presentation() *forms.Presentation
- func (this *SocketConnectivitySource) Thresholds() []*Threshold
- func (this *SocketConnectivitySource) Variables() []*SourceVariable
- type Source
- func (this *Source) Charts() []*widgets.Chart
- func (this *Source) Code() string
- func (this *Source) DataFormatCode() SourceDataFormat
- func (this *Source) Description() string
- func (this *Source) Platforms() []string
- func (this *Source) Presentation() *forms.Presentation
- func (this *Source) Stop() error
- func (this *Source) Thresholds() []*Threshold
- func (this *Source) Validate() error
- func (this *Source) Variables() []*SourceVariable
- type SourceCategory
- type SourceDataFormat
- type SourceInterface
- type SourceVariable
- type TaskConfig
- func (this *TaskConfig) AddEnv(name string, value string)
- func (this *TaskConfig) AddSchedule(schedule *ScheduleConfig)
- func (this *TaskConfig) FormattedScript() string
- func (this *TaskConfig) Generate() (path string, err error)
- func (this *TaskConfig) GenerateAgain() (path string, err error)
- func (this *TaskConfig) MatchKeyword(keyword string) (matched bool, name string, tags []string)
- func (this *TaskConfig) Next(now time.Time) (next time.Time, ok bool)
- func (this *TaskConfig) Validate() error
- type TeaWebSource
- func (this *TeaWebSource) Charts() []*widgets.Chart
- func (this *TeaWebSource) Code() string
- func (this *TeaWebSource) Description() string
- func (this *TeaWebSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *TeaWebSource) Form() *forms.Form
- func (this *TeaWebSource) Name() string
- func (this *TeaWebSource) Presentation() *forms.Presentation
- func (this *TeaWebSource) Thresholds() []*Threshold
- func (this *TeaWebSource) Variables() []*SourceVariable
- type Threshold
- func (this *Threshold) Eval(value interface{}, old interface{}) (string, error)
- func (this *Threshold) Expression() string
- func (this *Threshold) RunActions(params map[string]string) error
- func (this *Threshold) Test(value interface{}, oldValue interface{}) (ok bool, err error)
- func (this *Threshold) TestRow(value interface{}, oldValue interface{}) (ok bool, row interface{}, err error)
- func (this *Threshold) Validate() error
- type ThresholdOperator
- type URLConnectivitySource
- func (this *URLConnectivitySource) Charts() []*widgets.Chart
- func (this *URLConnectivitySource) Code() string
- func (this *URLConnectivitySource) Description() string
- func (this *URLConnectivitySource) Execute(params map[string]string) (value interface{}, err error)
- func (this *URLConnectivitySource) Form() *forms.Form
- func (this *URLConnectivitySource) Name() string
- func (this *URLConnectivitySource) Presentation() *forms.Presentation
- func (this *URLConnectivitySource) Thresholds() []*Threshold
- func (this *URLConnectivitySource) Variables() []*SourceVariable
- type Value
- type WebHookSource
- func (this *WebHookSource) Code() string
- func (this *WebHookSource) Description() string
- func (this *WebHookSource) Execute(params map[string]string) (value interface{}, err error)
- func (this *WebHookSource) Form() *forms.Form
- func (this *WebHookSource) Name() string
- func (this *WebHookSource) Presentation() *forms.Presentation
- func (this *WebHookSource) Validate() error
Constants ¶
const ( SourceCategoryBasic = "basic" // 基础 SourceCategoryCommon = "common" // 常用 SourceCategoryPlugin = "plugin" // 插件 )
const ( SourceDataFormatSingeLine = 1 // 单行 SourceDataFormatMultipleLine = 2 // 多行 SourceDataFormatJSON = 3 // JSON SourceDataFormatYAML = 4 // YAML )
Variables ¶
var RegexpParamNamedVariable = regexp.MustCompile(`(?U)\${[$\w\s.-]+(\s*\|.+)?}`)
参数值正则
Functions ¶
func AllDataSources ¶
func ConvertSourceToMap ¶ added in v0.1.2
func ConvertSourceToMap(source SourceInterface) map[string]interface{}
将Source转换为Map
func DecodeSource ¶
func DecodeSource(data []byte, format SourceDataFormat) (value interface{}, err error)
解码数据
func EvalParam ¶ added in v0.1.2
func EvalParam(param string, value interface{}, old interface{}, varMapping maps.Map, supportsMath bool) (string, error)
使用某个参数执行数值运算,使用Javascript语法
func FindSourceDataFormat ¶
func FindSourceDataFormat(dataFormat SourceDataFormat) maps.Map
取得单个数据格式
func FuncAppend ¶ added in v0.1.9
func FuncAppend(args ...interface{}) interface{}
附加字符串 append('a', 'b')
func FuncFloat ¶ added in v0.1.9
func FuncFloat(args ...interface{}) interface{}
浮点数处理 float | float('%.2f')
func FuncFloor ¶ added in v0.1.9
func FuncFloor(args ...interface{}) interface{}
对数字进行取不大于它的整数 floor
func FuncFormat ¶ added in v0.1.9
func FuncFormat(args ...interface{}) interface{}
格式化 format('%.2f')
func FuncRound ¶ added in v0.1.9
func FuncRound(args ...interface{}) interface{}
对数字四舍五入 round | round(2)
func RegisterDataSource ¶ added in v0.1.2
func RegisterDataSource(dataSource SourceInterface, category SourceCategory)
单个数据源信息
func RunFuncExpr ¶ added in v0.1.9
执行函数表达式
Types ¶
type ActionInterface ¶
type ActionInterface interface { // 名称 Name() string // 代号 Code() string // 描述 Description() string // 校验 Validate() error // 执行 Run(params map[string]string) (result string, err error) // 获取简要信息 Summary() maps.Map }
动作
func FindActionInstance ¶
func FindActionInstance(code string, options map[string]interface{}) ActionInterface
查找单个数据源实例
type AgentConfig ¶
type AgentConfig struct { Id string `yaml:"id" json:"id"` // ID On bool `yaml:"on" json:"on"` // 是否启用 Name string `yaml:"name" json:"name"` // 名称 Host string `yaml:"host" json:"host"` // 主机地址 Key string `yaml:"key" json:"key"` // 密钥 AllowAll bool `yaml:"allowAll" json:"allowAll"` // 是否允许所有的IP Allow []string `yaml:"allow" json:"allow"` // 允许的IP地址 Apps []*AppConfig `yaml:"apps" json:"apps"` // Apps TeaVersion string `yaml:"teaVersion" json:"teaVersion"` // TeaWeb版本 Version uint `yaml:"version" json:"version"` // 版本 CheckDisconnections bool `yaml:"checkDisconnections" json:"checkDisconnections"` // 是否检查离线 CountDisconnections int `yaml:"countDisconnections" json:"countDisconnections"` // 错误次数 GroupIds []string `yaml:"groupIds" json:"groupIds"` // 分组IDs AutoUpdates bool `yaml:"autoUpdates" json:"autoUpdates"` // 是否开启自动更新 AppsIsInitialized bool `yaml:"appsIsInitialized" json:"appsIsInitialized"` // 是否已经初始化App GroupKey string `yaml:"groupKey" json:"groupKey"` // 注册使用的密钥 NoticeSetting map[notices.NoticeLevel][]*notices.NoticeReceiver `yaml:"noticeSetting" json:"noticeSetting"` }
Agent定义
func LocalAgentConfig ¶
func LocalAgentConfig() *AgentConfig
func (*AgentConfig) AddDefaultApps ¶ added in v0.1.2
func (this *AgentConfig) AddDefaultApps()
添加内置的App
func (*AgentConfig) AddNoticeReceiver ¶ added in v0.1.2
func (this *AgentConfig) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
添加通知接收者
func (*AgentConfig) BelongsToGroup ¶ added in v0.1.7
func (this *AgentConfig) BelongsToGroup(groupId string) bool
判断是否有某个分组
func (*AgentConfig) BelongsToGroups ¶ added in v0.1.7
func (this *AgentConfig) BelongsToGroups(groupIds []string) bool
判断是否有某些分组
func (*AgentConfig) CountNoticeReceivers ¶ added in v0.1.2
func (this *AgentConfig) CountNoticeReceivers() int
获取通知接收者数量
func (*AgentConfig) FindAllNoticeReceivers ¶ added in v0.1.2
func (this *AgentConfig) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
查找一个或多个级别对应的接收者,并合并相同的接收者
func (*AgentConfig) FindItem ¶
func (this *AgentConfig) FindItem(itemId string) (appConfig *AppConfig, item *Item)
查找监控项
func (*AgentConfig) FindTask ¶
func (this *AgentConfig) FindTask(taskId string) (appConfig *AppConfig, taskConfig *TaskConfig)
查找任务
func (*AgentConfig) FirstGroup ¶ added in v0.1.8
func (this *AgentConfig) FirstGroup() *Group
取得第一个分组
func (*AgentConfig) HasApp ¶ added in v0.1.2
func (this *AgentConfig) HasApp(appId string) bool
判断是否有某个App
func (*AgentConfig) MatchKeyword ¶ added in v0.1.7
func (this *AgentConfig) MatchKeyword(keyword string) (matched bool, name string, tags []string)
判断是否匹配关键词
func (*AgentConfig) MoveApp ¶ added in v0.1.5
func (this *AgentConfig) MoveApp(fromIndex int, toIndex int)
移动App位置
func (*AgentConfig) RemoveMedia ¶ added in v0.1.2
func (this *AgentConfig) RemoveMedia(mediaId string) (found bool)
删除媒介
func (*AgentConfig) RemoveNoticeReceiver ¶ added in v0.1.2
func (this *AgentConfig) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
删除通知接收者
func (*AgentConfig) ReplaceApp ¶ added in v0.1.2
func (this *AgentConfig) ReplaceApp(app *AppConfig)
替换App,如果不存在则增加
type AgentList ¶
type AgentList struct { Files []string `yaml:"files" json:"files"` // contains filtered or unexported fields }
Agent列表
func (*AgentList) CountAgentsInGroup ¶ added in v0.1.8
计算所有分组中的Agent
type AppConfig ¶
type AppConfig struct { Id string `yaml:"id" json:"id"` // ID On bool `yaml:"on" json:"on"` // 是否启用 Tasks []*TaskConfig `yaml:"tasks" json:"tasks"` // 任务设置 Items []*Item `yaml:"item" json:"items"` // 监控项 Name string `yaml:"name" json:"name"` // 名称 NoticeSetting map[notices.NoticeLevel][]*notices.NoticeReceiver `yaml:"noticeSetting" json:"noticeSetting"` }
App定义
func (*AppConfig) AddNoticeReceiver ¶ added in v0.1.2
func (this *AppConfig) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
添加通知接收者
func (*AppConfig) CountNoticeReceivers ¶ added in v0.1.2
获取通知接收者数量
func (*AppConfig) FindAllNoticeReceivers ¶ added in v0.1.2
func (this *AppConfig) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
查找一个或多个级别对应的接收者,并合并相同的接收者
func (*AppConfig) FindBootingTasks ¶
func (this *AppConfig) FindBootingTasks() []*TaskConfig
Boot Tasks
func (*AppConfig) FindManualTasks ¶
func (this *AppConfig) FindManualTasks() []*TaskConfig
Manual Tasks
func (*AppConfig) FindSchedulingTasks ¶
func (this *AppConfig) FindSchedulingTasks() []*TaskConfig
Schedule Tasks
func (*AppConfig) MatchKeyword ¶ added in v0.1.7
匹配关键词
func (*AppConfig) RemoveMedia ¶ added in v0.1.2
删除媒介
func (*AppConfig) RemoveNoticeReceiver ¶ added in v0.1.2
func (this *AppConfig) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
删除通知接收者
type AppProcessesSource ¶ added in v0.1.2
type AppProcessesSource struct { Source `yaml:",inline"` CmdlineKeyword string `yaml:"cmdlineKeyword" json:"cmdlineKeyword"` // 命令行匹配关键词 }
App进程
func (*AppProcessesSource) Charts ¶ added in v0.1.2
func (this *AppProcessesSource) Charts() []*widgets.Chart
图表
func (*AppProcessesSource) Description ¶ added in v0.1.2
func (this *AppProcessesSource) Description() string
描述
func (*AppProcessesSource) Execute ¶ added in v0.1.2
func (this *AppProcessesSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*AppProcessesSource) Form ¶ added in v0.1.2
func (this *AppProcessesSource) Form() *forms.Form
表单信息
func (*AppProcessesSource) Platforms ¶ added in v0.1.2
func (this *AppProcessesSource) Platforms() []string
平台限制
func (*AppProcessesSource) Presentation ¶ added in v0.1.2
func (this *AppProcessesSource) Presentation() *forms.Presentation
显示信息
func (*AppProcessesSource) Thresholds ¶ added in v0.1.2
func (this *AppProcessesSource) Thresholds() []*Threshold
阈值
func (*AppProcessesSource) Variables ¶ added in v0.1.2
func (this *AppProcessesSource) Variables() []*SourceVariable
变量
type Board ¶
type Board struct { TeaVersion string `yaml:"teaVersion" json:"teaVersion"` Filename string `yaml:"filename" json:"filename"` Charts []*BoardChart `yaml:"charts" json:"charts"` }
看板
type BoardChart ¶
type BoardChart struct { AppId string `yaml:"appId" json:"appId"` ItemId string `yaml:"itemId" json:"itemId"` ChartId string `yaml:"chartId" json:"chartId"` Name string `yaml:"name" json:"name"` TimeType string `yaml:"timeType" json:"timeType"` // default, past, range TimePast teaconfigs.TimePast `yaml:"timePast" json:"timePast"` // 时间范围 DayFrom string `yaml:"dayFrom" json:"dayFrom"` DayTo string `yaml:"dayTo" json:"dayTo"` }
看板图表定义
type CPUSource ¶ added in v0.1.2
type CPUSource struct {
Source `yaml:",inline"`
}
CPU使用量
func (*CPUSource) Variables ¶ added in v0.1.2
func (this *CPUSource) Variables() []*SourceVariable
变量
type ConnectionsSource ¶ added in v0.1.2
type ConnectionsSource struct {
Source `yaml:",inline"`
}
网络连接数
func (*ConnectionsSource) Charts ¶ added in v0.1.2
func (this *ConnectionsSource) Charts() []*widgets.Chart
图表
func (*ConnectionsSource) Description ¶ added in v0.1.2
func (this *ConnectionsSource) Description() string
描述
func (*ConnectionsSource) Execute ¶ added in v0.1.2
func (this *ConnectionsSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*ConnectionsSource) Form ¶ added in v0.1.2
func (this *ConnectionsSource) Form() *forms.Form
表单信息
func (*ConnectionsSource) Presentation ¶ added in v0.1.2
func (this *ConnectionsSource) Presentation() *forms.Presentation
显示信息
func (*ConnectionsSource) Thresholds ¶ added in v0.1.2
func (this *ConnectionsSource) Thresholds() []*Threshold
阈值
func (*ConnectionsSource) Variables ¶ added in v0.1.2
func (this *ConnectionsSource) Variables() []*SourceVariable
变量
type DNSSource ¶ added in v0.1.2
type DNSSource struct { Source `yaml:",inline"` Domain string `yaml:"domain" json:"domain"` Type string `yaml:"type" json:"type"` // A, MX等 }
DNS检查
func (*DNSSource) Presentation ¶ added in v0.1.2
func (this *DNSSource) Presentation() *forms.Presentation
显示信息
func (*DNSSource) Variables ¶ added in v0.1.2
func (this *DNSSource) Variables() []*SourceVariable
变量
type DateSource ¶ added in v0.1.2
type DateSource struct {
Source `yaml:",inline"`
}
日期相关
func (*DateSource) Execute ¶ added in v0.1.2
func (this *DateSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*DateSource) Presentation ¶ added in v0.1.2
func (this *DateSource) Presentation() *forms.Presentation
显示信息
func (*DateSource) Thresholds ¶ added in v0.1.2
func (this *DateSource) Thresholds() []*Threshold
阈值
func (*DateSource) Variables ¶ added in v0.1.2
func (this *DateSource) Variables() []*SourceVariable
变量
type DiskSource ¶ added in v0.1.2
type DiskSource struct { Source `yaml:",inline"` ContainsAllMountPoints bool `yaml:"containsAllMountPoints" json:"containsAllMountPoints"` }
文件系统信息
func (*DiskSource) Execute ¶ added in v0.1.2
func (this *DiskSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*DiskSource) Presentation ¶ added in v0.1.7
func (this *DiskSource) Presentation() *forms.Presentation
显示信息
func (*DiskSource) Thresholds ¶ added in v0.1.2
func (this *DiskSource) Thresholds() []*Threshold
阈值
func (*DiskSource) Variables ¶ added in v0.1.2
func (this *DiskSource) Variables() []*SourceVariable
变量
type DockerSource ¶ added in v0.1.2
type DockerSource struct {
Source `yaml:",inline"`
}
Docker相关数据源
func (*DockerSource) Charts ¶ added in v0.1.2
func (this *DockerSource) Charts() []*widgets.Chart
图表
func (*DockerSource) Description ¶ added in v0.1.2
func (this *DockerSource) Description() string
描述
func (*DockerSource) Execute ¶ added in v0.1.2
func (this *DockerSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*DockerSource) Thresholds ¶ added in v0.1.2
func (this *DockerSource) Thresholds() []*Threshold
阈值
func (*DockerSource) Variables ¶ added in v0.1.2
func (this *DockerSource) Variables() []*SourceVariable
变量
type FileChangeSource ¶ added in v0.1.2
type FileChangeSource struct { Source `yaml:",inline"` Path string `yaml:"path" json:"path"` // contains filtered or unexported fields }
监控文件变化 TODO 增加权限变化监控
func (*FileChangeSource) Charts ¶ added in v0.1.2
func (this *FileChangeSource) Charts() []*widgets.Chart
图表
func (*FileChangeSource) Description ¶ added in v0.1.2
func (this *FileChangeSource) Description() string
描述
func (*FileChangeSource) Execute ¶ added in v0.1.2
func (this *FileChangeSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*FileChangeSource) Form ¶ added in v0.1.2
func (this *FileChangeSource) Form() *forms.Form
表单信息
func (*FileChangeSource) Presentation ¶ added in v0.1.2
func (this *FileChangeSource) Presentation() *forms.Presentation
显示信息
func (*FileChangeSource) Thresholds ¶ added in v0.1.2
func (this *FileChangeSource) Thresholds() []*Threshold
阈值
func (*FileChangeSource) Variables ¶ added in v0.1.2
func (this *FileChangeSource) Variables() []*SourceVariable
变量
type FileSource ¶
数据文件
func (*FileSource) Execute ¶
func (this *FileSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*FileSource) Presentation ¶ added in v0.1.2
func (this *FileSource) Presentation() *forms.Presentation
显示信息
type Group ¶
type Group struct { Id string `yaml:"id" json:"id"` IsDefault bool `yaml:"isDefault" json:"isDefault"` On bool `yaml:"on" json:"on"` Name string `yaml:"name" json:"name"` Index int `yaml:"index" json:"index"` NoticeSetting map[notices.NoticeLevel][]*notices.NoticeReceiver `yaml:"noticeSetting" json:"noticeSetting"` Key string `yaml:"key" json:"key"` // 密钥 DayFrom string `yaml:"dayFrom" json:"dayFrom"` // 有效开始日期 DayTo string `yaml:"dayTo" json:"dayTo"` // 有效结束日期 MaxAgents int `yaml:"maxAgents" json:"maxAgents"` // 可以容纳的Agents最大数量 CountAgents int `yaml:"countAgents" json:"countAgents"` // Keys []*GroupKey `yaml:"keys" json:"keys"` // 临时的Key }
Agent分组
func (*Group) AddNoticeReceiver ¶
func (this *Group) AddNoticeReceiver(level notices.NoticeLevel, receiver *notices.NoticeReceiver)
添加通知接收者
func (*Group) FindAllNoticeReceivers ¶ added in v0.1.2
func (this *Group) FindAllNoticeReceivers(level ...notices.NoticeLevel) []*notices.NoticeReceiver
查找一个或多个级别对应的接收者,并合并相同的接收者
func (*Group) IsDateAvailable ¶ added in v0.1.8
当前分组日期是否可用
func (*Group) MatchKeyword ¶ added in v0.1.7
匹配关键词
func (*Group) RemoveMedia ¶ added in v0.1.2
删除媒介
func (*Group) RemoveNoticeReceiver ¶
func (this *Group) RemoveNoticeReceiver(level notices.NoticeLevel, receiverId string)
删除通知接收者
type GroupKey ¶ added in v0.1.8
type GroupKey struct { Id string `yaml:"id" json:"id"` On bool `yaml:"on" json:"on"` Name string `yaml:"name" json:"name"` // 说明 Key string `yaml:"key" json:"key"` // 密钥 DayFrom string `yaml:"dayFrom" json:"dayFrom"` // 开始生效日期 DayTo string `yaml:"dayTo" json:"dayTo"` // 结束生效日期 MaxAgents int `yaml:"maxAgents" json:"maxAgents"` // 可以容纳的Agents最大数量 CountAgents int `yaml:"countAgents" json:"countAgents"` // 已使用的Agent }
Agent组密钥管理
func (*GroupKey) IsDateAvailable ¶ added in v0.1.8
当前分组Key日期是否可用
type GroupList ¶ added in v0.1.7
type GroupList struct { Groups []*Group `yaml:"groups" json:"groups"` TeaVersion string `yaml:"teaVersion" json:"teaVersion"` }
分组配置
func SharedGroupList ¶ added in v0.1.7
func SharedGroupList() *GroupList
取得公用的配置 一定会返回一个不为nil的GroupConfig
func (*GroupList) FindAllGroups ¶ added in v0.1.7
获取所有分组,包括默认分组
func (*GroupList) FindDefaultGroup ¶ added in v0.1.7
查找默认的分组
func (*GroupList) FindGroupWithKey ¶ added in v0.1.7
根据密钥查找分组
func (*GroupList) RemoveGroup ¶ added in v0.1.7
删除分组
type IOStatSource ¶ added in v0.1.8
type IOStatSource struct { Source `yaml:",inline"` // contains filtered or unexported fields }
IO统计
func (*IOStatSource) Charts ¶ added in v0.1.8
func (this *IOStatSource) Charts() []*widgets.Chart
图表
func (*IOStatSource) Description ¶ added in v0.1.8
func (this *IOStatSource) Description() string
描述
func (*IOStatSource) Execute ¶ added in v0.1.8
func (this *IOStatSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*IOStatSource) Thresholds ¶ added in v0.1.8
func (this *IOStatSource) Thresholds() []*Threshold
阈值
func (*IOStatSource) Variables ¶ added in v0.1.8
func (this *IOStatSource) Variables() []*SourceVariable
变量
type Item ¶
type Item struct { On bool `yaml:"on" json:"on"` Id string `yaml:"id" json:"id"` Name string `yaml:"name" json:"name"` SourceCode string `yaml:"sourceCode" json:"sourceCode"` // 数据源代号 SourceOptions map[string]interface{} `yaml:"sourceOptions" json:"sourceOptions"` // 数据源选项 Interval string `yaml:"interval" json:"interval"` // 刷新间隔 Thresholds []*Threshold `yaml:"thresholds" json:"thresholds"` // 阈值设置 Charts []*widgets.Chart `yaml:"charts" json:"charts"` // 图表 RecoverSuccesses int `yaml:"recoverSuccesses" json:"recoverSuccesses"` // 恢复的成功次数 // contains filtered or unexported fields }
数据指标项
func (*Item) AddFilterCharts ¶ added in v0.1.7
添加一组图表中的某几个
func (*Item) MatchKeyword ¶ added in v0.1.7
匹配关键词
type LoadSource ¶ added in v0.1.2
type LoadSource struct {
Source `yaml:",inline"`
}
负载
func (*LoadSource) Execute ¶ added in v0.1.2
func (this *LoadSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*LoadSource) Thresholds ¶ added in v0.1.2
func (this *LoadSource) Thresholds() []*Threshold
阈值
func (*LoadSource) Variables ¶ added in v0.1.2
func (this *LoadSource) Variables() []*SourceVariable
变量
type MemorySource ¶ added in v0.1.2
type MemorySource struct {
Source `yaml:",inline"`
}
内存使用量
func (*MemorySource) Charts ¶ added in v0.1.2
func (this *MemorySource) Charts() []*widgets.Chart
图表
func (*MemorySource) Description ¶ added in v0.1.2
func (this *MemorySource) Description() string
描述
func (*MemorySource) Execute ¶ added in v0.1.2
func (this *MemorySource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*MemorySource) Thresholds ¶ added in v0.1.2
func (this *MemorySource) Thresholds() []*Threshold
阈值
func (*MemorySource) Variables ¶ added in v0.1.2
func (this *MemorySource) Variables() []*SourceVariable
变量
type MySQLSource ¶ added in v0.1.2
type MySQLSource struct { Source `yaml:",inline"` Addr string `yaml:"addr" json:"addr"` Username string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` DatabaseName string `yaml:"databaseName" json:"databaseName"` TimeoutSeconds int `yaml:"timeoutSeconds" json:"timeoutSeconds"` SQL string `yaml:"sql" json:"sql"` // contains filtered or unexported fields }
MySQL SQL
func (*MySQLSource) Execute ¶ added in v0.1.2
func (this *MySQLSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*MySQLSource) Presentation ¶ added in v0.1.2
func (this *MySQLSource) Presentation() *forms.Presentation
显示信息
func (*MySQLSource) Thresholds ¶ added in v0.1.2
func (this *MySQLSource) Thresholds() []*Threshold
阈值
func (*MySQLSource) Variables ¶ added in v0.1.2
func (this *MySQLSource) Variables() []*SourceVariable
变量
type NetworkSource ¶ added in v0.1.2
type NetworkSource struct { Source `yaml:",inline"` InterfaceNames []string `yaml:"interfaceNames" json:"interfaceNames"` // contains filtered or unexported fields }
网络带宽等信息
func (*NetworkSource) Charts ¶ added in v0.1.2
func (this *NetworkSource) Charts() []*widgets.Chart
图表
func (*NetworkSource) Description ¶ added in v0.1.2
func (this *NetworkSource) Description() string
描述
func (*NetworkSource) Execute ¶ added in v0.1.2
func (this *NetworkSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*NetworkSource) Presentation ¶ added in v0.1.8
func (this *NetworkSource) Presentation() *forms.Presentation
显示信息
func (*NetworkSource) Thresholds ¶ added in v0.1.2
func (this *NetworkSource) Thresholds() []*Threshold
阈值
func (*NetworkSource) Variables ¶ added in v0.1.2
func (this *NetworkSource) Variables() []*SourceVariable
变量
type NginxStatusSource ¶ added in v0.1.2
type NginxStatusSource struct { Source `yaml:",inline"` URL string `yaml:"url" json:"url"` // contains filtered or unexported fields }
Nginx Status数据源
func (*NginxStatusSource) Charts ¶ added in v0.1.2
func (this *NginxStatusSource) Charts() []*widgets.Chart
图表
func (*NginxStatusSource) Description ¶ added in v0.1.2
func (this *NginxStatusSource) Description() string
描述
func (*NginxStatusSource) Execute ¶ added in v0.1.2
func (this *NginxStatusSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*NginxStatusSource) Form ¶ added in v0.1.2
func (this *NginxStatusSource) Form() *forms.Form
选项表单
func (*NginxStatusSource) Presentation ¶ added in v0.1.2
func (this *NginxStatusSource) Presentation() *forms.Presentation
显示信息
func (*NginxStatusSource) Thresholds ¶ added in v0.1.2
func (this *NginxStatusSource) Thresholds() []*Threshold
阈值
func (*NginxStatusSource) Validate ¶ added in v0.1.2
func (this *NginxStatusSource) Validate() error
校验
func (*NginxStatusSource) Variables ¶ added in v0.1.2
func (this *NginxStatusSource) Variables() []*SourceVariable
变量
type PingSource ¶ added in v0.1.2
Ping
func (*PingSource) Execute ¶ added in v0.1.2
func (this *PingSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*PingSource) Presentation ¶ added in v0.1.2
func (this *PingSource) Presentation() *forms.Presentation
显示信息
func (*PingSource) Thresholds ¶ added in v0.1.2
func (this *PingSource) Thresholds() []*Threshold
阈值
func (*PingSource) Variables ¶ added in v0.1.2
func (this *PingSource) Variables() []*SourceVariable
变量
type PostgreSQLSource ¶ added in v0.1.5
type PostgreSQLSource struct { Source `yaml:",inline"` Addr string `yaml:"addr" json:"addr"` Username string `yaml:"username" json:"username"` Password string `yaml:"password" json:"password"` DatabaseName string `yaml:"databaseName" json:"databaseName"` TimeoutSeconds int `yaml:"timeoutSeconds" json:"timeoutSeconds"` //SSLMode string `yaml:"sslMode" json:"sslMode"` SQL string `yaml:"sql" json:"sql"` // contains filtered or unexported fields }
Postgre SQL
func (*PostgreSQLSource) Charts ¶ added in v0.1.5
func (this *PostgreSQLSource) Charts() []*widgets.Chart
图表
func (*PostgreSQLSource) Description ¶ added in v0.1.5
func (this *PostgreSQLSource) Description() string
描述
func (*PostgreSQLSource) Execute ¶ added in v0.1.5
func (this *PostgreSQLSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*PostgreSQLSource) Form ¶ added in v0.1.5
func (this *PostgreSQLSource) Form() *forms.Form
表单信息
func (*PostgreSQLSource) Presentation ¶ added in v0.1.5
func (this *PostgreSQLSource) Presentation() *forms.Presentation
显示信息
func (*PostgreSQLSource) Thresholds ¶ added in v0.1.5
func (this *PostgreSQLSource) Thresholds() []*Threshold
阈值
func (*PostgreSQLSource) Variables ¶ added in v0.1.5
func (this *PostgreSQLSource) Variables() []*SourceVariable
变量
type ProcessLog ¶ added in v0.1.7
type ProcessLog struct { Id shared.ObjectId `var:"id" bson:"_id" json:"id"` // 数据库存储的ID AgentId string `bson:"agentId" json:"agentId"` TaskId string `bson:"taskId" json:"taskId"` ProcessId string `bson:"processId" json:"processId"` ProcessPid int `bson:"processPid" json:"processPid"` EventType string `bson:"eventType" json:"eventType"` // start, log, stop Data string `bson:"data" json:"data"` Timestamp int64 `bson:"timestamp" json:"timestamp"` // unix时间戳,单位为秒 TimeFormat struct { Year string `bson:"year" json:"year"` Month string `bson:"month" json:"month"` Week string `bson:"week" json:"week"` Day string `bson:"day" json:"day"` Hour string `bson:"hour" json:"hour"` Minute string `bson:"minute" json:"minute"` Second string `bson:"second" json:"second"` } `bson:"timeFormat" json:"timeFormat"` }
进程日志
func (*ProcessLog) SetDBColumns ¶ added in v0.1.8
func (this *ProcessLog) SetDBColumns(v maps.Map)
设置数据库列值
type ProcessesSource ¶ added in v0.1.2
type ProcessesSource struct {
Source `yaml:",inline"`
}
进程数
func (*ProcessesSource) Charts ¶ added in v0.1.2
func (this *ProcessesSource) Charts() []*widgets.Chart
图表
func (*ProcessesSource) Description ¶ added in v0.1.2
func (this *ProcessesSource) Description() string
描述
func (*ProcessesSource) Execute ¶ added in v0.1.2
func (this *ProcessesSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*ProcessesSource) Presentation ¶ added in v0.1.2
func (this *ProcessesSource) Presentation() *forms.Presentation
显示信息
func (*ProcessesSource) Thresholds ¶ added in v0.1.2
func (this *ProcessesSource) Thresholds() []*Threshold
阈值
func (*ProcessesSource) Variables ¶ added in v0.1.2
func (this *ProcessesSource) Variables() []*SourceVariable
变量
type ScheduleConfig ¶
type ScheduleConfig struct { SecondRanges []*ScheduleRangeConfig `yaml:"secondRanges" json:"secondRanges"` // 秒 MinuteRanges []*ScheduleRangeConfig `yaml:"minuteRanges" json:"minuteRanges"` // 分 HourRanges []*ScheduleRangeConfig `yaml:"hourRanges" json:"hourRanges"` // 小时 DayRanges []*ScheduleRangeConfig `yaml:"dayRanges" json:"dayRanges"` // 天 MonthRanges []*ScheduleRangeConfig `yaml:"monthRanges" json:"monthRanges"` // 月 YearRanges []*ScheduleRangeConfig `yaml:"yearRanges" json:"yearRanges"` // 年份 WeekDayRanges []*ScheduleRangeConfig `yaml:"weekDayRanges" json:"weekDayRanges"` // 一周中的某天,1-7 // contains filtered or unexported fields }
定时
func (*ScheduleConfig) AddDayRanges ¶
func (this *ScheduleConfig) AddDayRanges(r ...*ScheduleRangeConfig)
添加天设置
func (*ScheduleConfig) AddHourRanges ¶
func (this *ScheduleConfig) AddHourRanges(r ...*ScheduleRangeConfig)
添加小时设置
func (*ScheduleConfig) AddMinuteRanges ¶
func (this *ScheduleConfig) AddMinuteRanges(r ...*ScheduleRangeConfig)
添加分钟设置
func (*ScheduleConfig) AddMonthRanges ¶
func (this *ScheduleConfig) AddMonthRanges(r ...*ScheduleRangeConfig)
添加月设置
func (*ScheduleConfig) AddSecondRanges ¶
func (this *ScheduleConfig) AddSecondRanges(r ...*ScheduleRangeConfig)
添加秒设置
func (*ScheduleConfig) AddWeekDayRanges ¶
func (this *ScheduleConfig) AddWeekDayRanges(r ...*ScheduleRangeConfig)
添加周N设置
func (*ScheduleConfig) AddYearRanges ¶
func (this *ScheduleConfig) AddYearRanges(r ...*ScheduleRangeConfig)
添加年设置
type ScheduleRangeConfig ¶
type ScheduleRangeConfig struct { Every bool `yaml:"every" json:"every"` From int `yaml:"from" json:"from"` To int `yaml:"to" json:"to"` Step int `yaml:"step" json:"step"` Value int `yaml:"value" json:"value"` }
Schedule时间范围
type ScheduleRangeList ¶
type ScheduleRangeList struct { Every bool Ranges []*ScheduleRangeConfig }
定时列表
func (*ScheduleRangeList) Convert ¶
func (this *ScheduleRangeList) Convert(ranges []*ScheduleRangeConfig)
转换
type ScriptAction ¶
type ScriptAction struct { Path string `yaml:"path" json:"path"` ScriptType string `yaml:"scriptType" json:"scriptType"` // 脚本类型,可以为path, code ScriptLang string `yaml:"scriptLang" json:"scriptLang"` // 脚本语言 Script string `yaml:"script" json:"script"` // 脚本代码 Env []*shared.Variable `yaml:"env" json:"env"` // 环境变量设置 Cwd string `yaml:"cwd" json:"cwd"` }
Script文件数据源
func (*ScriptAction) Generate ¶
func (this *ScriptAction) Generate(id string) (path string, err error)
保存到本地
func (*ScriptAction) Name ¶
func (this *ScriptAction) Name() string
func (*ScriptAction) Run ¶
func (this *ScriptAction) Run(params map[string]string) (result string, err error)
执行
func (*ScriptAction) Validate ¶
func (this *ScriptAction) Validate() error
type ScriptSource ¶
type ScriptSource struct { Source `yaml:",inline"` Path string `yaml:"path" json:"path"` ScriptType string `yaml:"scriptType" json:"scriptType"` // 脚本类型,可以为path, code ScriptLang string `yaml:"scriptLang" json:"scriptLang"` // 脚本语言 Script string `yaml:"script" json:"script"` // 脚本代码 Env []*shared.Variable `yaml:"env" json:"env"` // 环境变量设置 Cwd string `yaml:"cwd" json:"cwd"` }
Script文件数据源
func (*ScriptSource) Execute ¶
func (this *ScriptSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*ScriptSource) Generate ¶
func (this *ScriptSource) Generate(id string) (path string, err error)
保存到本地
func (*ScriptSource) Presentation ¶ added in v0.1.2
func (this *ScriptSource) Presentation() *forms.Presentation
显示界面
type SocketConnectivitySource ¶ added in v0.1.2
type SocketConnectivitySource struct { Source `yaml:",inline"` Address string `yaml:"address" json:"address"` Network string `yaml:"network" json:"network"` }
Socket连通性
func NewSocketConnectivitySource ¶ added in v0.1.2
func NewSocketConnectivitySource() *SocketConnectivitySource
获取新对象
func (*SocketConnectivitySource) Charts ¶ added in v0.1.2
func (this *SocketConnectivitySource) Charts() []*widgets.Chart
图表
func (*SocketConnectivitySource) Code ¶ added in v0.1.2
func (this *SocketConnectivitySource) Code() string
代号
func (*SocketConnectivitySource) Description ¶ added in v0.1.2
func (this *SocketConnectivitySource) Description() string
描述
func (*SocketConnectivitySource) Execute ¶ added in v0.1.2
func (this *SocketConnectivitySource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*SocketConnectivitySource) Form ¶ added in v0.1.2
func (this *SocketConnectivitySource) Form() *forms.Form
表单信息
func (*SocketConnectivitySource) Name ¶ added in v0.1.2
func (this *SocketConnectivitySource) Name() string
名称
func (*SocketConnectivitySource) Presentation ¶ added in v0.1.2
func (this *SocketConnectivitySource) Presentation() *forms.Presentation
显示信息
func (*SocketConnectivitySource) Thresholds ¶ added in v0.1.2
func (this *SocketConnectivitySource) Thresholds() []*Threshold
阈值
func (*SocketConnectivitySource) Variables ¶ added in v0.1.2
func (this *SocketConnectivitySource) Variables() []*SourceVariable
变量
type Source ¶ added in v0.1.2
type Source struct {
DataFormat SourceDataFormat `yaml:"dataFormat" json:"dataFormat"` // 数据格式
}
数据源基础定义
func (*Source) DataFormatCode ¶ added in v0.1.2
func (this *Source) DataFormatCode() SourceDataFormat
获得数据格式
func (*Source) Presentation ¶ added in v0.1.2
func (this *Source) Presentation() *forms.Presentation
显示信息
type SourceInterface ¶
type SourceInterface interface { // 名称 Name() string // 代号 Code() string // 描述 Description() string // 校验 Validate() error // 执行 Execute(params map[string]string) (value interface{}, err error) // 获得数据格式 DataFormatCode() SourceDataFormat // 表单信息 Form() *forms.Form // 显示信息 Presentation() *forms.Presentation // 数据变量定义 Variables() []*SourceVariable // 阈值 Thresholds() []*Threshold // 图表 Charts() []*widgets.Chart // 支持的平台 Platforms() []string // 停止 Stop() error }
数据源接口定义
func FindDataSourceInstance ¶
func FindDataSourceInstance(code string, options map[string]interface{}) SourceInterface
查找单个数据源实例
type SourceVariable ¶ added in v0.1.2
type SourceVariable struct { Code string `yaml:"code" json:"code"` Description string `yaml:"description" json:"description"` }
数据源变量
type TaskConfig ¶
type TaskConfig struct { Id string `yaml:"id" json:"id"` // ID On bool `yaml:"on" json:"on"` // 是否启用 Name string `yaml:"name" json:"name"` // 名称 Cwd string `yaml:"cwd" json:"cwd"` // 当前工作目录(Current Working Directory) Env []*shared.Variable `yaml:"env" json:"env"` // 环境变量设置 Script string `yaml:"script" json:"script"` // 脚本 IsBooting bool `yaml:"isBooting" json:"isBooting"` // 在Boot时启动 Schedule []*ScheduleConfig `yaml:"schedule" json:"schedule"` // 定时 IsManual bool `yaml:"isManual" json:"isManual"` // 是否手工调用 Version uint `yaml:"version" json:"version"` // 版本 }
任务 日志存储在 task.${id}
func (*TaskConfig) GenerateAgain ¶
func (this *TaskConfig) GenerateAgain() (path string, err error)
重新生成
func (*TaskConfig) MatchKeyword ¶ added in v0.1.7
func (this *TaskConfig) MatchKeyword(keyword string) (matched bool, name string, tags []string)
匹配关键词
type TeaWebSource ¶ added in v0.1.2
type TeaWebSource struct { Source `yaml:",inline"` API string `yaml:"api" json:"api"` Timeout int `yaml:"timeout" json:"timeout"` }
TeaWeb相关数据源
func (*TeaWebSource) Charts ¶ added in v0.1.2
func (this *TeaWebSource) Charts() []*widgets.Chart
图表
func (*TeaWebSource) Description ¶ added in v0.1.2
func (this *TeaWebSource) Description() string
描述
func (*TeaWebSource) Execute ¶ added in v0.1.2
func (this *TeaWebSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*TeaWebSource) Presentation ¶ added in v0.1.2
func (this *TeaWebSource) Presentation() *forms.Presentation
显示信息
func (*TeaWebSource) Thresholds ¶ added in v0.1.2
func (this *TeaWebSource) Thresholds() []*Threshold
阈值
func (*TeaWebSource) Variables ¶ added in v0.1.2
func (this *TeaWebSource) Variables() []*SourceVariable
变量
type Threshold ¶
type Threshold struct { Id string `yaml:"id" json:"id"` // ID Param string `yaml:"param" json:"param"` // 参数 Operator ThresholdOperator `yaml:"operator" json:"operator"` // 运算符 Value string `yaml:"value" json:"value"` // 对比值 NoticeLevel notices.NoticeLevel `yaml:"noticeLevel" json:"noticeLevel"` // 通知级别 NoticeMessage string `yaml:"noticeMessage" json:"noticeMessage"` // 通知消息 Actions []map[string]interface{} `yaml:"actions" json:"actions"` // 动作配置 MaxFails int `yaml:"maxFails" json:"maxFails"` // 连续失败次数 // contains filtered or unexported fields }
阈值定义
func (*Threshold) RunActions ¶
执行动作
type ThresholdOperator ¶
type ThresholdOperator = string
运算符定义
const ( ThresholdOperatorRegexp ThresholdOperator = "regexp" ThresholdOperatorNotRegexp ThresholdOperator = "not regexp" ThresholdOperatorGt ThresholdOperator = "gt" ThresholdOperatorGte ThresholdOperator = "gte" ThresholdOperatorLt ThresholdOperator = "lt" ThresholdOperatorLte ThresholdOperator = "lte" ThresholdOperatorEq ThresholdOperator = "eq" ThresholdOperatorNumberEq ThresholdOperator = "number eq" ThresholdOperatorNot ThresholdOperator = "not" ThresholdOperatorPrefix ThresholdOperator = "prefix" ThresholdOperatorSuffix ThresholdOperator = "suffix" ThresholdOperatorContains ThresholdOperator = "contains" ThresholdOperatorNotContains ThresholdOperator = "not contains" ThresholdOperatorVersionRange ThresholdOperator = "version range" // IP相关 ThresholdOperatorEqIP ThresholdOperator = "eq ip" ThresholdOperatorGtIP ThresholdOperator = "gt ip" ThresholdOperatorGteIP ThresholdOperator = "gte ip" ThresholdOperatorLtIP ThresholdOperator = "lt ip" ThresholdOperatorLteIP ThresholdOperator = "lte ip" ThresholdOperatorIPRange ThresholdOperator = "ip range" )
type URLConnectivitySource ¶ added in v0.1.2
type URLConnectivitySource struct { Source `yaml:",inline"` Timeout int `yaml:"timeout" json:"timeout"` // 连接超时 URL string `yaml:"url" json:"url"` Method string `yaml:"method" json:"method"` Headers []*shared.Variable `yaml:"headers" json:"headers"` Params []*shared.Variable `yaml:"params" json:"params"` TextBody string `yaml:"textBody" json:"textBody"` }
URL连通性
func NewURLConnectivitySource ¶ added in v0.1.2
func NewURLConnectivitySource() *URLConnectivitySource
获取新对象
func (*URLConnectivitySource) Charts ¶ added in v0.1.2
func (this *URLConnectivitySource) Charts() []*widgets.Chart
图表
func (*URLConnectivitySource) Code ¶ added in v0.1.2
func (this *URLConnectivitySource) Code() string
代号
func (*URLConnectivitySource) Description ¶ added in v0.1.2
func (this *URLConnectivitySource) Description() string
描述
func (*URLConnectivitySource) Execute ¶ added in v0.1.2
func (this *URLConnectivitySource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*URLConnectivitySource) Form ¶ added in v0.1.2
func (this *URLConnectivitySource) Form() *forms.Form
表单信息
func (*URLConnectivitySource) Name ¶ added in v0.1.2
func (this *URLConnectivitySource) Name() string
名称
func (*URLConnectivitySource) Presentation ¶ added in v0.1.2
func (this *URLConnectivitySource) Presentation() *forms.Presentation
显示信息
func (*URLConnectivitySource) Thresholds ¶ added in v0.1.2
func (this *URLConnectivitySource) Thresholds() []*Threshold
阈值
func (*URLConnectivitySource) Variables ¶ added in v0.1.2
func (this *URLConnectivitySource) Variables() []*SourceVariable
变量
type Value ¶
type Value struct { Id shared.ObjectId `bson:"_id" json:"id"` // 数据库存储的ID NodeId string `bson:"nodeId" json:"nodeId"` // 节点ID AgentId string `bson:"agentId" json:"agentId"` // Agent ID AppId string `bson:"appId" json:"appId"` // App ID ItemId string `bson:"itemId" json:"itemId"` // 监控项ID Timestamp int64 `bson:"timestamp" json:"timestamp"` // Agent时间戳 CreatedAt int64 `bson:"createdAt" json:"createdAt"` // 触发时间 CostMs float64 `bson:"costMs" json:"costMs"` // 耗时ms Value interface{} `bson:"value" json:"value"` // 值,可以是个标量,或者一个组合的值 Error string `bson:"error" json:"error"` // 错误信息 NoticeLevel notices.NoticeLevel `bson:"noticeLevel" json:"noticeLevel"` // 通知级别 IsNotified bool `bson:"isNotified" json:"isNotified"` // 是否已通知 ThresholdId string `bson:"thresholdId" json:"thresholdId"` // 阈值ID Threshold string `bson:"threshold" json:"threshold"` // 阈值描述 TimeFormat struct { Year string `bson:"year" json:"year"` Month string `bson:"month" json:"month"` Week string `bson:"week" json:"week"` Day string `bson:"day" json:"day"` Hour string `bson:"hour" json:"hour"` Minute string `bson:"minute" json:"minute"` Second string `bson:"second" json:"second"` } `bson:"timeFormat" json:"timeFormat"` }
应用指标值定义
func (*Value) AllFlatKeys ¶ added in v0.1.8
将Value扁平化然后获取Key
type WebHookSource ¶
type WebHookSource struct { Source `yaml:",inline"` URL string `yaml:"url" json:"url"` Timeout string `yaml:"timeout" json:"timeout"` Method string `yaml:"method" json:"method"` // 请求方法 Headers []*shared.Variable `yaml:"headers" json:"headers"` Params []*shared.Variable `yaml:"params" json:"params"` TextBody string `yaml:"textBody" json:"textBody"` // contains filtered or unexported fields }
WebHook
func (*WebHookSource) Execute ¶
func (this *WebHookSource) Execute(params map[string]string) (value interface{}, err error)
执行
func (*WebHookSource) Presentation ¶ added in v0.1.2
func (this *WebHookSource) Presentation() *forms.Presentation
Source Files ¶
- action.go
- action_script.go
- agent.go
- agent_list.go
- app.go
- board.go
- board_chart.go
- group.go
- group_key.go
- group_list.go
- init.go
- item.go
- process_log.go
- schedule.go
- schedule_range.go
- schedule_range_list.go
- source.go
- source_app_processes.go
- source_category.go
- source_connections.go
- source_cpu.go
- source_data_format.go
- source_date.go
- source_disk.go
- source_dns.go
- source_docker.go
- source_file.go
- source_file_change.go
- source_interface.go
- source_iostat.go
- source_load.go
- source_load_unix_like.go
- source_memory.go
- source_memory_unix_like.go
- source_mysql.go
- source_network.go
- source_nginx_status.go
- source_ping.go
- source_postgres.go
- source_processes.go
- source_script.go
- source_socket_connectivity.go
- source_teaweb.go
- source_url_connectivity.go
- source_utils.go
- source_variable.go
- source_webhook.go
- task.go
- threshold.go
- threshold_operator.go
- value.go
- var.go
- var_func.go