Documentation ¶
Overview ¶
Package configs 所有任务Config的基类文件
Package configs 该文件提供给tcp udp http script作为TaskConfig基类使用,其他的任务的TaskConfig基类已修改为base.go中的BaseTaskConfig
Index ¶
- Constants
- Variables
- func EnsureProcsyncHash(i int32) int32
- func IsContainerMode() bool
- func IsProcsyncHash(i int32) bool
- func SetContainerMode(v bool)
- type BaseTaskMetaParam
- type BaseTaskParam
- func (t *BaseTaskParam) CleanParams() error
- func (t *BaseTaskParam) GetAvailableDuration() time.Duration
- func (t *BaseTaskParam) GetBizID() int32
- func (t *BaseTaskParam) GetDataID() int32
- func (t *BaseTaskParam) GetIdent() string
- func (t *BaseTaskParam) GetLabels() []map[string]string
- func (t *BaseTaskParam) GetPeriod() time.Duration
- func (t *BaseTaskParam) GetTaskID() int32
- func (t *BaseTaskParam) GetTimeout() time.Duration
- func (t *BaseTaskParam) SetIdent(ident string)
- type BasereportConfig
- type CheckMode
- type ChildTaskConfig
- type ChildTaskMetaConfig
- type ConcurrencyLimitConfig
- type Config
- type CpuConfig
- type DiskConfig
- type ExceptionBeatConfig
- type GatherUpBeatConfig
- type HTTPTaskConfig
- type HTTPTaskMetaConfig
- type HTTPTaskStepConfig
- type HeartBeatConfig
- type IPType
- type KeywordConfig
- type KeywordTaskConfig
- type KeywordTaskMetaConfig
- type KubeEventConfig
- type Label
- type LoginLogConfig
- type MemConfig
- type MetricBeatConfig
- type MetricBeatMetaConfig
- type ModulesConfig
- type NetConfig
- type NetTaskMetaParam
- type NetTaskParam
- func (t *NetTaskParam) CleanParams() error
- func (t *NetTaskParam) GetAvailableDuration() time.Duration
- func (t *NetTaskParam) GetBizID() int32
- func (t *NetTaskParam) GetDataID() int32
- func (t *NetTaskParam) GetIdent() string
- func (t *NetTaskParam) GetLabels() []map[string]string
- func (t *NetTaskParam) GetPeriod() time.Duration
- func (t *NetTaskParam) GetTaskID() int32
- func (t *NetTaskParam) GetTimeout() time.Duration
- type PingTaskConfig
- type PingTaskMetaConfig
- type ProcBinConfig
- type ProcConfig
- type ProcCustomConfig
- func (c *ProcCustomConfig) Clean() error
- func (c *ProcCustomConfig) EnablePerfCollected() bool
- func (c *ProcCustomConfig) EnablePortCollected() bool
- func (c *ProcCustomConfig) ExtractDimensions(name string) map[string]string
- func (c *ProcCustomConfig) ExtractProcessName(name string) string
- func (c *ProcCustomConfig) GetPeriod() time.Duration
- func (c *ProcCustomConfig) GetTaskConfigList() []define.TaskConfig
- func (c *ProcCustomConfig) GetType() string
- func (c *ProcCustomConfig) InitIdent() error
- func (c *ProcCustomConfig) Match(procs []define.ProcStat) []define.ProcStat
- func (c *ProcCustomConfig) Setup()
- type ProcSnapshotConfig
- type ProcStatusConfig
- type ProcSyncConfig
- type ProcessbeatBindInfo
- type ProcessbeatConfig
- func (c *ProcessbeatConfig) Clean() error
- func (c *ProcessbeatConfig) EnablePerfCollected() bool
- func (c *ProcessbeatConfig) EnablePortCollected() bool
- func (c *ProcessbeatConfig) EnableTopCollected() bool
- func (c *ProcessbeatConfig) GetConfigByID(id string) ProcessbeatPortConfig
- func (c *ProcessbeatConfig) GetPeriod() time.Duration
- func (c *ProcessbeatConfig) GetTaskConfigList() []define.TaskConfig
- func (c *ProcessbeatConfig) GetType() string
- func (c *ProcessbeatConfig) InitIdent() error
- func (c *ProcessbeatConfig) MatchNames(proc common.MapStr) map[string]struct{}
- func (c *ProcessbeatConfig) MatchNotExists(exists map[string]struct{}) []ProcessbeatPortConfig
- func (c *ProcessbeatConfig) MatchRegex(names map[string]struct{}, param string) []ProcessbeatPortConfig
- func (c *ProcessbeatConfig) Setup()
- type ProcessbeatPortConfig
- type ProtocolType
- type RpmPackageConfig
- type ScriptTaskConfig
- type ScriptTaskMetaConfig
- type ShellHistoryConfig
- type SimpleMatchParam
- type SimpleTaskParam
- type SocketSnapshotConfig
- type StaticTaskConfig
- type StaticTaskMetaConfig
- type TCPTaskConfig
- type TCPTaskMetaConfig
- type Target
- type TaskConcurrencyLimitConfig
- type TrapConfig
- type TrapMetaConfig
- type UDPTaskConfig
- type UDPTaskMetaConfig
- type USMConfig
- type UsmInfo
Constants ¶
const ( DiskRO DiskSpace Core OOM )
const ( EncodingUTF8 = "utf-8" EncodingGBK = "gbk" // 任务类型 TaskTypeRawLog = "raw_log" TaskTypeKeyword = "keyword" ConfigTypeKeyword = define.ModuleKeyword // 结果聚合发送方式 OutputFormatEvent = "event" DefaultRetainFileBytes = 1024 * 1024 // 1MB )
const ( DefaultTargetHost string = "127.0.0.1" DefaultTargetPort int = 80 DefaultResponseFormat string = "startswith" )
const (
ConfigTypeHTTP = define.ModuleHTTP
)
const (
ConfigTypeKubeevent = "kubeevent"
)
const (
ConfigTypeMetric = "metricbeat"
)
config类型定义
const (
ConfigTypePing = define.ModulePing
)
config类型定义
const (
ConfigTypeScript = define.ModuleScript
)
const (
ConfigTypeStatic = define.ModuleStatic
)
config类型定义
const (
ConfigTypeTCP = define.ModuleTCP
)
const (
ConfigTypeTrap = define.ModuleTrap
)
config类型定义
const (
ConfigTypeUDP = define.ModuleUDP
)
const (
DefaultBufferSize int = 102400
)
默认的网络通信读写缓存长度
Variables ¶
var DefaultBasereportConfig = BasereportConfig{ Cpu: CpuConfig{ StatTimes: 4, InfoPeriod: 1 * time.Minute, InfoTimeout: 30 * time.Second, ReportCpuFlag: false, }, Disk: DiskConfig{ StatTimes: 1, DiskWhiteList: []*regexp.Regexp{}, DiskBlackList: []*regexp.Regexp{}, PartitionWhiteList: []*regexp.Regexp{}, PartitionBlackList: []*regexp.Regexp{}, MountpointWhiteList: []*regexp.Regexp{}, MountpointBlackList: []*regexp.Regexp{}, }, Mem: MemConfig{ InfoTimes: 1, SpecialSource: false, }, Net: NetConfig{ StatTimes: 4, InterfaceWhiteList: []*regexp.Regexp{}, InterfaceBlackList: []*regexp.Regexp{}, RevertProtectNumber: 100, }, ReportCrontab: false, ReportHosts: false, ReportRoute: false, }
var DefaultExceptionBeatConfig = ExceptionBeatConfig{ CheckBit: 0, CheckMethod: "", CheckDisRoInterval: time.Hour, CheckDiskSpaceInterval: time.Hour, CheckOutOfMemInterval: time.Hour, OutOfMemReportGap: time.Minute, DiskUsagePercent: 90, DiskMinFreeSpace: 10, CoreFileReportGap: time.Minute, CoreFilePattern: "", }
var DisableNetlink bool // 是否禁用 netlink 禁用:true 不禁用 false,默认 false
var FastBasereportConfig = BasereportConfig{ Cpu: CpuConfig{ StatTimes: 1, StatPeriod: 1, InfoPeriod: 1 * time.Minute, InfoTimeout: 30 * time.Second, ReportCpuFlag: false, }, Disk: DiskConfig{ StatTimes: 1, StatPeriod: 1, DiskWhiteList: []*regexp.Regexp{}, DiskBlackList: []*regexp.Regexp{}, PartitionWhiteList: []*regexp.Regexp{}, PartitionBlackList: []*regexp.Regexp{}, MountpointWhiteList: []*regexp.Regexp{}, MountpointBlackList: []*regexp.Regexp{}, }, Mem: MemConfig{ InfoTimes: 1, InfoPeriod: 1, SpecialSource: false, }, Net: NetConfig{ StatTimes: 1, StatPeriod: 1, InterfaceWhiteList: []*regexp.Regexp{}, InterfaceBlackList: []*regexp.Regexp{}, RevertProtectNumber: 100, }, ReportCrontab: false, ReportHosts: false, ReportRoute: false, }
Functions ¶
func EnsureProcsyncHash ¶
func IsContainerMode ¶
func IsContainerMode() bool
func IsProcsyncHash ¶
func SetContainerMode ¶
func SetContainerMode(v bool)
Types ¶
type BaseTaskMetaParam ¶
type BaseTaskMetaParam struct { DataID int32 `config:"dataid" validate:"required"` MaxTimeout time.Duration `config:"max_timeout" validate:"min=1s"` MinPeriod time.Duration `config:"min_period" validate:"min=1s"` }
BaseTaskMetaParam : 基础组任务信息
func (*BaseTaskMetaParam) CleanParams ¶
func (c *BaseTaskMetaParam) CleanParams() error
CleanParams :
func (*BaseTaskMetaParam) CleanTask ¶
func (c *BaseTaskMetaParam) CleanTask(task define.TaskConfig) error
CleanTask :
type BaseTaskParam ¶
type BaseTaskParam struct { Ident string `config:"ident,ignore"` DataID int32 `config:"dataid"` BizID int32 `config:"bk_biz_id"` TaskID int32 `config:"task_id" validate:"required"` Timeout time.Duration `config:"timeout"` AvailableDuration time.Duration `config:"available_duration"` Period time.Duration `config:"period" validate:"min=1s"` Labels []map[string]string `config:"labels"` Tags map[string]string `config:"tags"` Sorted define.Tags // contains filtered or unexported fields }
BaseTaskParam 任务基础信息,实现了TaskConfig中除Clean以外的所有接口,实现了CompositableConfig的CleanConfig接口,以便进行配置批量清洗操作
func (*BaseTaskParam) CleanParams ¶
func (t *BaseTaskParam) CleanParams() error
CleanParams CompositableParam接口,用于批量清洗
func (*BaseTaskParam) GetAvailableDuration ¶
func (t *BaseTaskParam) GetAvailableDuration() time.Duration
GetAvailableDuration 获取可用区间
func (*BaseTaskParam) GetDataID ¶
func (t *BaseTaskParam) GetDataID() int32
GetDataID 获取用于上报数据的dataid
func (*BaseTaskParam) GetLabels ¶
func (t *BaseTaskParam) GetLabels() []map[string]string
GetLabels 获取注入的标签
func (*BaseTaskParam) GetPeriod ¶
func (t *BaseTaskParam) GetPeriod() time.Duration
GetPeriod 获取任务执行周期
func (*BaseTaskParam) GetTimeout ¶
func (t *BaseTaskParam) GetTimeout() time.Duration
GetTimeout 获取任务超时时间
type BasereportConfig ¶
type BasereportConfig struct { BaseTaskParam `config:"_,inline"` TimeTolerate int64 `config:"time_tolerate"` // module detail configs Cpu CpuConfig `config:"cpu"` Disk DiskConfig `config:"disk"` Mem MemConfig `config:"mem"` Net NetConfig `config:"net"` // 环境信息的上报开关 ReportCrontab bool `config:"report_crontab"` ReportHosts bool `config:"report_hosts"` ReportRoute bool `config:"report_route"` }
BasereportConfig
func NewBasereportConfig ¶
func NewBasereportConfig(root *Config) *BasereportConfig
func (*BasereportConfig) Clean ¶
func (c *BasereportConfig) Clean() error
func (*BasereportConfig) GetIdent ¶
func (c *BasereportConfig) GetIdent() string
func (*BasereportConfig) GetTaskConfigList ¶
func (c *BasereportConfig) GetTaskConfigList() []define.TaskConfig
func (*BasereportConfig) GetType ¶
func (c *BasereportConfig) GetType() string
func (*BasereportConfig) InitIdent ¶
func (c *BasereportConfig) InitIdent() error
type CheckMode ¶
type CheckMode string
CheckMode 域名检测模式
const ( // CheckModeAll 检测域名所有IP CheckModeAll CheckMode = "all" // CheckModeSingle 检测域名单个IP CheckModeSingle CheckMode = "single" // DefaultDNSCheckMode 默认域名检测模式 DefaultDNSCheckMode = CheckModeSingle )
type ChildTaskConfig ¶
ChildTaskConfig 额外封装一层子配置参数,用于计算ident,不实际应用到任务列表
type ChildTaskMetaConfig ¶
type ChildTaskMetaConfig struct { define.TaskMetaConfig `config:"_,inline"` Version string `config:"version"` Name string `config:"name"` Type string `config:"type"` Path string }
ChildTaskMetaConfig 子任务config,在基础任务模板上添加子任务记录信息
type ConcurrencyLimitConfig ¶
type ConcurrencyLimitConfig struct {
Task map[string]*TaskConcurrencyLimitConfig `config:"task"`
}
ConcurrencyLimitConfig 并发限制配置
type Config ¶
type Config struct { TaskTypeMapping map[string]define.TaskMetaConfig `config:"_"` CheckInterval time.Duration `config:"check_interval" validate:"positive"` CleanUpTimeout time.Duration `config:"clean_up_timeout" validate:"min=1s"` EventBufferSize int `config:"event_buffer_size" validate:"positive"` Mode string `config:"mode" validate:"regexp=(daemon|check|cron)"` KeepOneDimension bool `config:"keep_one_dimension"` MetricsBatchSize int `config:"metrics_batch_size"` // 最大批次数,单个任务最大只能上报该批次*batch_size量级的数据 MaxMetricBatches int `config:"max_metric_batches"` AdminAddr string `config:"admin_addr"` // 并发限制配置 ConcurrencyLimit ConcurrencyLimitConfig `config:"concurrency_limit"` MetricbeatWorkers int `config:"metricbeat_workers"` MetricbeatSpreadWorkload bool `config:"metricbeat_spread_workload"` MetricbeatAlignTs bool `config:"metricbeat_align_ts"` NodeID string `config:"node_id" validate:"required"` IP string `config:"ip" validate:"nonzero"` BizID int32 `config:"bk_biz_id" validate:"required"` CloudID int32 `config:"bk_cloud_id" validate:"required"` HostIDPath string `config:"host_id_path"` CmdbLevelMaxLength int `config:"cmdb_level_max_length"` IgnoreCmdbLevel bool `config:"ignore_cmdb_level"` MustHostIDExist bool `config:"must_host_id_exist"` DisableNetLink bool `config:"disable_netlink"` TCPTask *TCPTaskMetaConfig `config:"tcp_task"` HeartBeat *HeartBeatConfig `config:"heart_beat"` GatherUpBeat *GatherUpBeatConfig `config:"gather_up_beat"` UDPTask *UDPTaskMetaConfig `config:"udp_task"` HTTPTask *HTTPTaskMetaConfig `config:"http_task"` ScriptTask *ScriptTaskMetaConfig `config:"script_task"` PingTask *PingTaskMetaConfig `config:"ping_task"` MetricTask *MetricBeatMetaConfig `config:"metricbeat_task"` KeywordTask *KeywordTaskMetaConfig `config:"keyword_task"` TrapTask *TrapMetaConfig `config:"trap_task"` StaticTask *StaticTaskMetaConfig `config:"static_task"` BaseReportTask *BasereportConfig `config:"basereport_task"` ExceptionBeatTask *ExceptionBeatConfig `config:"exceptionbeat_task"` KubeeventTask *KubeEventConfig `config:"kubeevent_task"` ProcessBeatTask *ProcessbeatConfig `config:"processbeat_task"` ProcConfTask *ProcConfig `config:"procconf_task"` ProcCustomTask *ProcCustomConfig `config:"proccustom_task"` ProcSyncTask *ProcSyncConfig `config:"procsync_task"` ProcStatusTask *ProcStatusConfig `config:"procstatus_task"` LoginLogTask *LoginLogConfig `config:"loginlog_task"` ProcSnapshotTask *ProcSnapshotConfig `config:"procsnapshot_task"` ProcBinTask *ProcBinConfig `config:"procbin_task"` SocketSnapshotTask *SocketSnapshotConfig `config:"socketsnapshot_task"` ShellHistoryTask *ShellHistoryConfig `config:"shellhistory_task"` RpmPackageTask *RpmPackageConfig `config:"rpmpackage_task"` }
Config : global config
func (*Config) GetGatherUpDataID ¶
func (*Config) GetTaskConfigList ¶
func (c *Config) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
func (*Config) GetTaskConfigListByType ¶
func (c *Config) GetTaskConfigListByType(configType string) []define.TaskConfig
GetTaskConfigListByType :
func (*Config) GetTaskTypeMapping ¶
func (c *Config) GetTaskTypeMapping() map[string]define.TaskMetaConfig
GetTaskTypeMapping :
type DiskConfig ¶
type DiskConfig struct { // collector times in one period StatTimes int `config:"stat_times"` StatPeriod time.Duration `config:",ignore"` CollectAllDev bool `config:"collect_all_device"` DropDuplicateDevice bool `config:"drop_duplicate_device"` IOSkipPartition bool `config:"io_skip_partition"` DiskWhiteListPattern []string `config:"disk_white_list"` DiskWhiteList []*regexp.Regexp `config:",ignore"` DiskBlackListPattern []string `config:"disk_black_list"` DiskBlackList []*regexp.Regexp `config:",ignore"` PartitionWhiteListPattern []string `config:"partition_white_list"` PartitionWhiteList []*regexp.Regexp `config:",ignore"` PartitionBlackListPattern []string `config:"partition_black_list"` PartitionBlackList []*regexp.Regexp `config:",ignore"` MountpointWhiteListPattern []string `config:"mountpoint_white_list"` MountpointWhiteList []*regexp.Regexp `config:",ignore"` MountpointBlackListPattern []string `config:"mountpoint_black_list"` MountpointBlackList []*regexp.Regexp `config:",ignore"` FSTypeBlackListPattern []string `config:"fs_type_black_list"` FSTypeBlackList []*regexp.Regexp `config:",ignore"` FSTypeWhiteListPattern []string `config:"fs_type_white_list"` FSTypeWhiteList []*regexp.Regexp `config:",ignore"` }
type ExceptionBeatConfig ¶
type ExceptionBeatConfig struct { BaseTaskParam `config:"_,inline"` CheckBit int `config:",ignore"` CheckMethod string `config:"check_bit"` CheckDisRoInterval time.Duration `config:"check_disk_ro_interval"` CheckDiskSpaceInterval time.Duration `config:"check_disk_space_interval"` CheckOutOfMemInterval time.Duration `config:"check_oom_interval"` OutOfMemReportGap time.Duration `config:"oom_report_gap"` DiskUsagePercent int `config:"used_max_disk_space_percent"` DiskMinFreeSpace int `config:"free_min_disk_space"` DiskRoWhiteList []string `config:"disk_ro_white_list"` DiskRoBlackList []string `config:"disk_ro_black_list"` CoreFileReportGap time.Duration `config:"corefile_report_gap"` CoreFilePattern string `config:"corefile_pattern"` CoreFileMatchRegex string `config:"corefile_match_regex"` }
func NewExceptionBeatConfig ¶
func NewExceptionBeatConfig(root *Config) *ExceptionBeatConfig
func (*ExceptionBeatConfig) Clean ¶
func (c *ExceptionBeatConfig) Clean() error
func (*ExceptionBeatConfig) GetIdent ¶
func (c *ExceptionBeatConfig) GetIdent() string
func (*ExceptionBeatConfig) GetTaskConfigList ¶
func (c *ExceptionBeatConfig) GetTaskConfigList() []define.TaskConfig
func (*ExceptionBeatConfig) GetType ¶
func (c *ExceptionBeatConfig) GetType() string
func (*ExceptionBeatConfig) InitIdent ¶
func (c *ExceptionBeatConfig) InitIdent() error
type GatherUpBeatConfig ¶
type GatherUpBeatConfig struct {
DataID int32 `config:"dataid"`
}
func NewGatherUpBeatConfig ¶
func NewGatherUpBeatConfig() *GatherUpBeatConfig
type HTTPTaskConfig ¶
type HTTPTaskConfig struct { NetTaskParam `config:"_,inline"` Proxy string `config:"proxy"` InsecureSkipVerify bool `config:"insecure_skip_verify"` Steps []*HTTPTaskStepConfig `config:"steps"` }
HTTPTaskConfig :
type HTTPTaskMetaConfig ¶
type HTTPTaskMetaConfig struct { NetTaskMetaParam `config:"_,inline"` Tasks []*HTTPTaskConfig `config:"tasks"` }
HTTPTaskMetaConfig :
func NewHTTPTaskMetaConfig ¶
func NewHTTPTaskMetaConfig(root *Config) *HTTPTaskMetaConfig
NewHTTPTaskMetaConfig :
func (*HTTPTaskMetaConfig) GetTaskConfigList ¶
func (c *HTTPTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type HTTPTaskStepConfig ¶
type HTTPTaskStepConfig struct { SimpleMatchParam `config:"_,inline"` URL string `config:"url"` URLList []string `config:"url_list"` Method string `config:"method"` Headers map[string]string `config:"headers"` ResponseCode string `config:"response_code"` ResponseCodeList []int `config:"response_code_list"` }
HTTPTaskStepConfig :
func (*HTTPTaskStepConfig) URLs ¶
func (c *HTTPTaskStepConfig) URLs() []string
type HeartBeatConfig ¶
type HeartBeatConfig struct { // bkmonitorbeeat下的心跳data id配置 GlobalDataID int32 `config:"global_dataid" ` ChildDataID int32 `config:"child_dataid"` // uptimecheckbeat下的心跳data id配置,缺少子任务的data_id DataID int32 `config:"dataid"` Period time.Duration `config:"period" validate:"min=1s"` PublishImmediately bool `config:"publish_immediately"` }
HeartBeatConfig : 心跳配置,该配置是供bkmonitorbeat及uptimecheckbeat共同使用
type KeywordConfig ¶
type KeywordConfig struct { Name string `config:"name"` // 匹配规则名 Pattern string `config:"pattern"` // 正则匹配规则 }
日志关键字匹配规则配置
type KeywordTaskConfig ¶
type KeywordTaskConfig struct { BaseTaskParam `config:"_,inline"` DataID int `config:"dataid"` // 上报数据ID // Type string `config:"type"` // 任务类型 Paths []string `config:"paths"` // 采集的文件路径 ExcludeFiles []string `config:"exclude_files"` // 需要过滤的文件列表,正则表示 Encoding string `config:"encoding"` // 文件编码类型 ScanSleep time.Duration `config:"scan_sleep"` // 文件扫描休眠时间,用于减少CPU负载,默认1us CloseInactive time.Duration `config:"close_inactive"` // 文件未更新需要关闭的超时等待 // Delimiter string `config:"delimiter"` // 行文件的分隔符 ReportPeriod time.Duration `config:"report_period"` // 上报周期 FilterPatterns []string `config:"filter_patterns"` // 过滤规则 KeywordConfigs []KeywordConfig `config:"keywords"` // 日志关键字匹配规则 OutputFormat string `config:"output_format"` // 结果输出格式 Target string `config:"target"` // 采集目标 TimeUnit string `config:"time_unit"` // 上报时间单位,默认是ms Label []Label `config:"labels"` RetainFileBytes int64 `config:"retain_file_bytes"` // 保留前置文件的尾部数据 }
func (*KeywordTaskConfig) Clean ¶
func (c *KeywordTaskConfig) Clean() error
func (*KeywordTaskConfig) GetType ¶
func (c *KeywordTaskConfig) GetType() string
func (*KeywordTaskConfig) InitIdent ¶
func (c *KeywordTaskConfig) InitIdent() error
type KeywordTaskMetaConfig ¶
type KeywordTaskMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` Tasks []*KeywordTaskConfig `config:"tasks"` }
KeywordTaskMetaConfig
func NewKeywordTaskMetaConfig ¶
func NewKeywordTaskMetaConfig(root *Config) *KeywordTaskMetaConfig
NewKeywordTaskMetaConfig :
func (*KeywordTaskMetaConfig) Clean ¶
func (c *KeywordTaskMetaConfig) Clean() error
func (*KeywordTaskMetaConfig) GetTaskConfigList ¶
func (c *KeywordTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
type KubeEventConfig ¶
type KubeEventConfig struct { BaseTaskParam `config:"_,inline"` EventSpan time.Duration `config:"event_span"` Interval time.Duration `config:"interval"` TailFiles []string `config:"tail_files"` UpMetricsDataID int32 `config:"upmetrics_dataid"` // 自监控 dataid }
func NewKubeEventConfig ¶
func NewKubeEventConfig(root *Config) *KubeEventConfig
func (*KubeEventConfig) Clean ¶
func (c *KubeEventConfig) Clean() error
func (*KubeEventConfig) GetTaskConfigList ¶
func (c *KubeEventConfig) GetTaskConfigList() []define.TaskConfig
func (*KubeEventConfig) GetType ¶
func (c *KubeEventConfig) GetType() string
func (*KubeEventConfig) InitIdent ¶
func (c *KubeEventConfig) InitIdent() error
type Label ¶
type Label struct { BkCollectConfigID string `config:"bk_collect_config_id"` BkTargetCloudID string `config:"bk_target_cloud_id"` BkTargetIP string `config:"bk_target_ip"` BKTargetServiceCategoryID string `config:"bk_target_service_category_id"` BKTargetServiceInstanceID string `config:"bk_target_service_instance_id"` BkTargetTopoID string `config:"bk_target_topo_id"` BkTargetTopoLevel string `config:"bk_target_topo_level"` }
采集下发来源配置说明
func (*Label) IsHostDynamicTopoNode ¶
是否为按主机,动态节点下发的Label
type LoginLogConfig ¶
type LoginLogConfig struct {
BaseTaskParam `config:"_,inline"`
}
func NewLoginLogConfig ¶
func NewLoginLogConfig(root *Config) *LoginLogConfig
func (*LoginLogConfig) Clean ¶
func (c *LoginLogConfig) Clean() error
func (*LoginLogConfig) GetIdent ¶
func (c *LoginLogConfig) GetIdent() string
func (*LoginLogConfig) GetTaskConfigList ¶
func (c *LoginLogConfig) GetTaskConfigList() []define.TaskConfig
func (*LoginLogConfig) GetType ¶
func (c *LoginLogConfig) GetType() string
func (*LoginLogConfig) InitIdent ¶
func (c *LoginLogConfig) InitIdent() error
type MetricBeatConfig ¶
type MetricBeatConfig struct { BaseTaskParam `config:"_,inline"` Module *common.Config `config:"module"` // 是否使用自定义指标格式上报 CustomReport bool `config:"custom_report"` Workers int SpreadWorkload bool EnableAlignTs bool }
MetricBeatConfig :
func (*MetricBeatConfig) InitIdent ¶
func (c *MetricBeatConfig) InitIdent() error
InitIdent 覆盖BaseTaskParam的同名方法,因为metricbeat直接调用原方法会panic
type MetricBeatMetaConfig ¶
type MetricBeatMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` Tasks []*MetricBeatConfig `config:"tasks"` }
MetricBeatMetaConfig : associate task config
func NewMetricBeatMetaConfig ¶
func NewMetricBeatMetaConfig(root *Config) *MetricBeatMetaConfig
NewMetricBeatMetaConfig :
func (*MetricBeatMetaConfig) GetTaskConfigList ¶
func (c *MetricBeatMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type ModulesConfig ¶
type ModulesConfig struct { Task BaseTaskParam Module string // 将modules序列化成json后存储 }
ModulesConfig modules结构体,只用于获取ident过程
type NetConfig ¶
type NetConfig struct { // collector times in one period StatTimes int `config:"stat_times"` StatPeriod time.Duration `config:",ignore"` SkipVirtualInterface bool `config:"skip_virtual_interface"` RevertProtectNumber uint64 `config:"revert_protect_number"` ForceReportList []*regexp.Regexp `config:",ignore"` ForceReportListPattern []string `config:"force_report_list"` InterfaceWhiteListPattern []string `config:"interface_white_list"` InterfaceWhiteList []*regexp.Regexp `config:",ignore"` InterfaceBlackListPattern []string `config:"interface_black_list"` InterfaceBlackList []*regexp.Regexp `config:",ignore"` }
type NetTaskMetaParam ¶
type NetTaskMetaParam struct { BaseTaskMetaParam `config:"_,inline"` MaxBufferSize int `config:"max_buffer_size" validate:"positive"` TaskConfigPath string `config:"config_path"` }
NetTaskMetaParam : task parameter
func (*NetTaskMetaParam) CleanTask ¶
func (c *NetTaskMetaParam) CleanTask(task define.TaskConfig) error
CleanTask 覆盖了BaseTaskMetaParam的CleanTask逻辑,因为增加了buffersize
type NetTaskParam ¶
type NetTaskParam struct { BaseTaskParam `config:"_,inline"` BufferSize int `config:"buffer_size" validate:"positive"` TargetIPType IPType `config:"target_ip_type"` // 域名检测模式 DNSCheckMode CheckMode `config:"dns_check_mode"` }
NetTaskParam : tcp task parameter
func (*NetTaskParam) GetAvailableDuration ¶
func (t *NetTaskParam) GetAvailableDuration() time.Duration
GetAvailableDuration :
type PingTaskConfig ¶
type PingTaskConfig struct { BaseTaskParam `config:"_,inline"` TargetIPType IPType `config:"target_ip_type"` // 域名检测模式 DNSCheckMode CheckMode `config:"dns_check_mode"` Targets []*Target `config:"targets"` MaxRTT string `config:"max_rtt"` BatchSize int `config:"batch_size"` TotalNum int `config:"total_num"` PingSize int `config:"ping_size"` }
PingTaskConfig :
type PingTaskMetaConfig ¶
type PingTaskMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` Tasks []*PingTaskConfig `config:"tasks"` }
PingTaskMetaConfig : associate task config
func NewPingTaskMetaConfig ¶
func NewPingTaskMetaConfig(root *Config) *PingTaskMetaConfig
NewPingTaskMetaConfig :
func (*PingTaskMetaConfig) GetTaskConfigList ¶
func (c *PingTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type ProcBinConfig ¶
type ProcBinConfig struct { BaseTaskParam `config:"_,inline"` MaxBytes int64 `config:"max_bytes"` }
func NewProcBinConfig ¶
func NewProcBinConfig(root *Config) *ProcBinConfig
func (*ProcBinConfig) Clean ¶
func (c *ProcBinConfig) Clean() error
func (*ProcBinConfig) GetIdent ¶
func (c *ProcBinConfig) GetIdent() string
func (*ProcBinConfig) GetTaskConfigList ¶
func (c *ProcBinConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcBinConfig) GetType ¶
func (c *ProcBinConfig) GetType() string
func (*ProcBinConfig) InitIdent ¶
func (c *ProcBinConfig) InitIdent() error
type ProcConfig ¶
type ProcConfig struct { BaseTaskParam `config:"_,inline" yaml:"-"` TaskID int32 `config:"task_id" yaml:"task_id"` Period time.Duration `config:"period" yaml:"period"` PortDataId int32 `config:"portdataid" yaml:"portdataid"` TopDataId int32 `config:"topdataid" yaml:"topdataid"` PerfDataId int32 `config:"perfdataid" yaml:"perfdataid"` ConvergePID bool `config:"converge_pid" yaml:"converge_pid"` HostFilePath string `config:"hostfilepath" yaml:"hostfilepath"` DstDir string `config:"dst_dir" yaml:"dst_dir"` }
func NewProcConf ¶
func NewProcConf(root *Config) *ProcConfig
func (*ProcConfig) Clean ¶
func (c *ProcConfig) Clean() error
func (*ProcConfig) GetIdent ¶
func (c *ProcConfig) GetIdent() string
func (*ProcConfig) GetPeriod ¶
func (c *ProcConfig) GetPeriod() time.Duration
func (*ProcConfig) GetTaskConfigList ¶
func (c *ProcConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcConfig) GetType ¶
func (c *ProcConfig) GetType() string
func (*ProcConfig) InitIdent ¶
func (c *ProcConfig) InitIdent() error
type ProcCustomConfig ¶
type ProcCustomConfig struct { BaseTaskParam `config:"_,inline"` PortDataID int `config:"port_dataid"` MatchPattern string `config:"match_pattern"` // 匹配正则,只做匹配工作,不提取维度 ProcessName string `config:"process_name"` // 进程名匹配规则,作为多进程时的区分维度 DimPattern string `config:"extract_pattern"` // 额外维度提取正则,只提取维度,不做匹配工作 ExcludePattern string `config:"exclude_pattern"` // 除外正则,匹配该正则的进程被除外不上报 PIDPath string `config:"pid_path"` ProcMetric []string `config:"proc_metric"` PortDetect bool `config:"port_detect"` Ports []string `config:"ports"` ListenPortOnly bool `config:"listen_port_only"` // 只采集监听端口 ReportUnexpectedPort bool `config:"report_unexpected_port"` // 如果配置了指定端口,是否对额外端口信息进行上报 DisableMapping bool `config:"disable_mapping"` // 不进行 pid 映射 // contains filtered or unexported fields }
func NewProcCustomConfig ¶
func NewProcCustomConfig(root *Config) *ProcCustomConfig
func (*ProcCustomConfig) Clean ¶
func (c *ProcCustomConfig) Clean() error
func (*ProcCustomConfig) EnablePerfCollected ¶
func (c *ProcCustomConfig) EnablePerfCollected() bool
func (*ProcCustomConfig) EnablePortCollected ¶
func (c *ProcCustomConfig) EnablePortCollected() bool
func (*ProcCustomConfig) ExtractDimensions ¶
func (c *ProcCustomConfig) ExtractDimensions(name string) map[string]string
func (*ProcCustomConfig) ExtractProcessName ¶
func (c *ProcCustomConfig) ExtractProcessName(name string) string
func (*ProcCustomConfig) GetPeriod ¶
func (c *ProcCustomConfig) GetPeriod() time.Duration
func (*ProcCustomConfig) GetTaskConfigList ¶
func (c *ProcCustomConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcCustomConfig) GetType ¶
func (c *ProcCustomConfig) GetType() string
func (*ProcCustomConfig) InitIdent ¶
func (c *ProcCustomConfig) InitIdent() error
func (*ProcCustomConfig) Match ¶
func (c *ProcCustomConfig) Match(procs []define.ProcStat) []define.ProcStat
func (*ProcCustomConfig) Setup ¶
func (c *ProcCustomConfig) Setup()
type ProcSnapshotConfig ¶
type ProcSnapshotConfig struct {
BaseTaskParam `config:"_,inline"`
}
func NewProcSnapshotConfig ¶
func NewProcSnapshotConfig(root *Config) *ProcSnapshotConfig
func (*ProcSnapshotConfig) Clean ¶
func (c *ProcSnapshotConfig) Clean() error
func (*ProcSnapshotConfig) GetIdent ¶
func (c *ProcSnapshotConfig) GetIdent() string
func (*ProcSnapshotConfig) GetTaskConfigList ¶
func (c *ProcSnapshotConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcSnapshotConfig) GetType ¶
func (c *ProcSnapshotConfig) GetType() string
func (*ProcSnapshotConfig) InitIdent ¶
func (c *ProcSnapshotConfig) InitIdent() error
type ProcStatusConfig ¶
type ProcStatusConfig struct { BaseTaskParam `config:"_,inline"` ReportPeriod time.Duration `config:"report_period" validate:"min=1s"` // 上报周期 }
func NewProcStatusConfig ¶
func NewProcStatusConfig(root *Config) *ProcStatusConfig
func (*ProcStatusConfig) Clean ¶
func (p *ProcStatusConfig) Clean() error
func (*ProcStatusConfig) GetTaskConfigList ¶
func (p *ProcStatusConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcStatusConfig) GetType ¶
func (p *ProcStatusConfig) GetType() string
func (*ProcStatusConfig) InitIdent ¶
func (p *ProcStatusConfig) InitIdent() error
type ProcSyncConfig ¶
type ProcSyncConfig struct { BaseTaskParam `config:"_,inline"` TaskID int32 `config:"task_id"` DstDir string `config:"dst_dir"` }
func NewProcSyncConfig ¶
func NewProcSyncConfig(root *Config) *ProcSyncConfig
func (*ProcSyncConfig) Clean ¶
func (c *ProcSyncConfig) Clean() error
func (*ProcSyncConfig) GetIdent ¶
func (c *ProcSyncConfig) GetIdent() string
func (*ProcSyncConfig) GetPeriod ¶
func (c *ProcSyncConfig) GetPeriod() time.Duration
func (*ProcSyncConfig) GetTaskConfigList ¶
func (c *ProcSyncConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcSyncConfig) GetType ¶
func (c *ProcSyncConfig) GetType() string
func (*ProcSyncConfig) InitIdent ¶
func (c *ProcSyncConfig) InitIdent() error
type ProcessbeatBindInfo ¶
type ProcessbeatConfig ¶
type ProcessbeatConfig struct { BaseTaskParam `config:"_,inline" yaml:"-"` Type string `config:"type" yaml:"type"` Name string `config:"name" yaml:"name"` TaskId int32 `config:"task_id" yaml:"task_id"` Version string `config:"version" yaml:"version"` PortDataId int32 `config:"portdataid" yaml:"portdataid"` TopDataId int32 `config:"topdataid" yaml:"topdataid"` PerfDataId int32 `config:"perfdataid" yaml:"perfdataid"` Period time.Duration `config:"period" yaml:"period"` HostFilePath string `config:"hostfilepath" yaml:"hostfilepath"` Processes []ProcessbeatPortConfig `config:"processes" yaml:"processes"` CmdbLevelMaxLength int `config:"cmdb_level_max_length" yaml:"cmdb_level_max_length"` IgnoreCmdbLevel bool `config:"ignore_cmdb_level" yaml:"ignore_cmdb_level"` MustHostIDExist bool `config:"must_host_id_exist" yaml:"must_host_id_exist"` MonitorCollectorPath string `config:"monitor_collector_path" yaml:"monitor_collector_path"` ConvergePID bool `config:"converge_pid" yaml:"converge_pid"` MaxNoListenPorts int `config:"max_nolisten_ports" yaml:"max_nolisten_ports"` // contains filtered or unexported fields }
func NewProcessbeatConfig ¶
func NewProcessbeatConfig(root *Config) *ProcessbeatConfig
func (*ProcessbeatConfig) Clean ¶
func (c *ProcessbeatConfig) Clean() error
func (*ProcessbeatConfig) EnablePerfCollected ¶
func (c *ProcessbeatConfig) EnablePerfCollected() bool
func (*ProcessbeatConfig) EnablePortCollected ¶
func (c *ProcessbeatConfig) EnablePortCollected() bool
func (*ProcessbeatConfig) EnableTopCollected ¶
func (c *ProcessbeatConfig) EnableTopCollected() bool
func (*ProcessbeatConfig) GetConfigByID ¶
func (c *ProcessbeatConfig) GetConfigByID(id string) ProcessbeatPortConfig
func (*ProcessbeatConfig) GetPeriod ¶
func (c *ProcessbeatConfig) GetPeriod() time.Duration
func (*ProcessbeatConfig) GetTaskConfigList ¶
func (c *ProcessbeatConfig) GetTaskConfigList() []define.TaskConfig
func (*ProcessbeatConfig) GetType ¶
func (c *ProcessbeatConfig) GetType() string
func (*ProcessbeatConfig) InitIdent ¶
func (c *ProcessbeatConfig) InitIdent() error
func (*ProcessbeatConfig) MatchNames ¶
func (c *ProcessbeatConfig) MatchNames(proc common.MapStr) map[string]struct{}
MatchNames 分析进程的信息,将进程的启动 exe 名等提取为 map,方便后面判断使用
func (*ProcessbeatConfig) MatchNotExists ¶
func (c *ProcessbeatConfig) MatchNotExists(exists map[string]struct{}) []ProcessbeatPortConfig
func (*ProcessbeatConfig) MatchRegex ¶
func (c *ProcessbeatConfig) MatchRegex(names map[string]struct{}, param string) []ProcessbeatPortConfig
MatchRegex 匹配进程的信息和参数是否一致 names: key 为进程的不同信息,包括: exe/exe 的 base name/cmdline 的 base name 等,具体参考 MatchNames 函数 param: 具体匹配进程的参数信息
func (*ProcessbeatConfig) Setup ¶
func (c *ProcessbeatConfig) Setup()
type ProcessbeatPortConfig ¶
type ProcessbeatPortConfig struct { Name string `config:"name" yaml:"name"` DisplayName string `config:"displayname" yaml:"displayname"` Protocol string `config:"protocol" yaml:"protocol"` Ports []uint16 `config:"ports" yaml:"ports"` ParamRegex string `config:"paramregex" yaml:"paramregex"` BindIP string `config:"bindip" yaml:"bindip"` BindInfoList []ProcessbeatBindInfo `config:"bind_info" yaml:"bind_info"` }
func (ProcessbeatPortConfig) GetBindDetailed ¶
func (c ProcessbeatPortConfig) GetBindDetailed() []ProcessbeatBindInfo
func (ProcessbeatPortConfig) ID ¶
func (c ProcessbeatPortConfig) ID() string
type ProtocolType ¶
type ProtocolType int32
const ( Http ProtocolType = 0 Tcp ProtocolType = 1 Udp ProtocolType = 2 Icmp ProtocolType = 2 )
type RpmPackageConfig ¶
type RpmPackageConfig struct { BaseTaskParam `config:"_,inline"` BlockWriteBytes int `config:"block_write_bytes"` BlockReadBytes int `config:"block_read_bytes"` BlockWriteIOps int `config:"block_write_iops"` BlockReadIOps int `config:"block_read_iops"` }
func NewRpmPackageConfig ¶
func NewRpmPackageConfig(root *Config) *RpmPackageConfig
func (*RpmPackageConfig) Clean ¶
func (c *RpmPackageConfig) Clean() error
func (*RpmPackageConfig) GetIdent ¶
func (c *RpmPackageConfig) GetIdent() string
func (*RpmPackageConfig) GetTaskConfigList ¶
func (c *RpmPackageConfig) GetTaskConfigList() []define.TaskConfig
func (*RpmPackageConfig) GetType ¶
func (c *RpmPackageConfig) GetType() string
func (*RpmPackageConfig) InitIdent ¶
func (c *RpmPackageConfig) InitIdent() error
type ScriptTaskConfig ¶
type ScriptTaskConfig struct { BaseTaskParam `config:"_,inline"` Command string `config:"command"` TimestampUnit string `config:"timestamp_unit"` UserEnvs map[string]string `config:"user_env"` TimeOffset time.Duration `config:"time_offset"` }
ScriptTaskConfig :
type ScriptTaskMetaConfig ¶
type ScriptTaskMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` TaskConfigPath string `config:"config_path"` Tasks []*ScriptTaskConfig `config:"tasks"` }
ScriptTaskMetaConfig : tcp task config
func NewScriptTaskMetaConfig ¶
func NewScriptTaskMetaConfig(root *Config) *ScriptTaskMetaConfig
NewScriptTaskMetaConfig :
func (*ScriptTaskMetaConfig) GetTaskConfigList ¶
func (c *ScriptTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type ShellHistoryConfig ¶
type ShellHistoryConfig struct { BaseTaskParam `config:"_,inline"` LastBytes int64 `config:"last_bytes"` HistoryFiles []string `config:"history_files"` }
func NewShellHistoryConfig ¶
func NewShellHistoryConfig(root *Config) *ShellHistoryConfig
func (*ShellHistoryConfig) Clean ¶
func (c *ShellHistoryConfig) Clean() error
func (*ShellHistoryConfig) GetIdent ¶
func (c *ShellHistoryConfig) GetIdent() string
func (*ShellHistoryConfig) GetTaskConfigList ¶
func (c *ShellHistoryConfig) GetTaskConfigList() []define.TaskConfig
func (*ShellHistoryConfig) GetType ¶
func (c *ShellHistoryConfig) GetType() string
func (*ShellHistoryConfig) InitIdent ¶
func (c *ShellHistoryConfig) InitIdent() error
type SimpleMatchParam ¶
type SimpleMatchParam struct { Request string `config:"request"` RequestFormat string `config:"request_format" validate:"regexp=^(raw|hex)?$"` Response string `config:"response"` // 支持匹配函数:reg, eq, nq, startswith, nstartswith, endswith, nendswith, in, nin, wildcard // 支持数据格式:raw, hex // ResponseFormat: $format|$function 比如 raw|ng / raw|in / hex|nin ResponseFormat string `config:"response_format"` }
SimpleMatchParam :
type SimpleTaskParam ¶
type SimpleTaskParam struct { TargetHost string `config:"target_host"` // 支持多个目标,当配置多个目标时忽略单个目标配置 TargetHostList []string `config:"target_host_list"` TargetPort int `config:"target_port" validate:"required,min=1"` }
SimpleTaskParam :
func (*SimpleTaskParam) Hosts ¶
func (c *SimpleTaskParam) Hosts() []string
type SocketSnapshotConfig ¶
type SocketSnapshotConfig struct { BaseTaskParam `config:"_,inline"` Detector string `config:"detector"` }
func NewSocketSnapshotConfig ¶
func NewSocketSnapshotConfig(root *Config) *SocketSnapshotConfig
func (*SocketSnapshotConfig) Clean ¶
func (c *SocketSnapshotConfig) Clean() error
func (*SocketSnapshotConfig) GetIdent ¶
func (c *SocketSnapshotConfig) GetIdent() string
func (*SocketSnapshotConfig) GetTaskConfigList ¶
func (c *SocketSnapshotConfig) GetTaskConfigList() []define.TaskConfig
func (*SocketSnapshotConfig) GetType ¶
func (c *SocketSnapshotConfig) GetType() string
func (*SocketSnapshotConfig) InitIdent ¶
func (c *SocketSnapshotConfig) InitIdent() error
type StaticTaskConfig ¶
type StaticTaskConfig struct { BaseTaskParam `config:"_,inline"` CheckPeriod time.Duration `config:"check_period"` ReportPeriod time.Duration `config:"report_period"` VirtualIfaceWhitelist []string `config:"virtual_iface_whitelist"` }
StaticTaskConfig :
type StaticTaskMetaConfig ¶
type StaticTaskMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` Tasks []*StaticTaskConfig `config:"tasks"` }
StaticTaskMetaConfig : associate task config
func NewStaticTaskMetaConfig ¶
func NewStaticTaskMetaConfig(root *Config) *StaticTaskMetaConfig
NewStaticTaskMetaConfig :
func (*StaticTaskMetaConfig) GetTaskConfigList ¶
func (c *StaticTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type TCPTaskConfig ¶
type TCPTaskConfig struct { NetTaskParam `config:"_,inline"` SimpleMatchParam `config:"_,inline"` SimpleTaskParam `config:"_,inline"` }
TCPTaskConfig :
type TCPTaskMetaConfig ¶
type TCPTaskMetaConfig struct { NetTaskMetaParam `config:"_,inline"` Tasks []*TCPTaskConfig `config:"tasks"` }
TCPTaskMetaConfig : tcp task config
func NewTCPTaskMetaConfig ¶
func NewTCPTaskMetaConfig(root *Config) *TCPTaskMetaConfig
NewTCPTaskMetaConfig :
func (*TCPTaskMetaConfig) GetTaskConfigList ¶
func (c *TCPTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type TaskConcurrencyLimitConfig ¶
type TaskConcurrencyLimitConfig struct { PerInstanceLimit int64 `config:"per_instance"` // 全局限制 PerTaskLimit int64 `config:"per_task"` // 单任务限制 }
TaskConcurrencyLimitConfig 任务并发限制配置
func (*TaskConcurrencyLimitConfig) Clean ¶
func (tcc *TaskConcurrencyLimitConfig) Clean()
Clean 初始化参数
type TrapConfig ¶
type TrapConfig struct { BaseTaskParam `config:"_,inline"` IP string `config:"listen_ip"` Port int `config:"listen_port"` Version string `config:"snmp_version"` Community string `config:"community"` IsAggregate bool `config:"aggregate"` Concurrency int `config:"concurrency"` AggregatePeriod time.Duration `config:"aggregate_period"` // oid翻译字典 OIDS map[string]string `config:"oids"` // 用户指定的需要作为维度上报的oid ReportOIDDimensions []string `config:"report_oid_dimensions"` // 用户指定的value不需要解析为字符的oid RawByteOIDs []string `config:"raw_byte_oids"` Target string `config:"target"` Label []Label `config:"labels"` // v3参数 UsmInfos []UsmInfo `config:"usm_info"` // oids排序拼成string 用于hash Tags define.Tags // 翻译oid value时若是中文,则可能需要该配置 Encode string `config:"encode"` // 是否将oid维度转换为翻译后的英文名再上报 UseDisplayNameOID bool `config:"use_display_name_oid"` // 是否关闭agent_port维度上报,该维度可以看作是一个无意义随机值 HideAgentPort bool `config:"hide_agent_port"` }
TrapConfig :
type TrapMetaConfig ¶
type TrapMetaConfig struct { BaseTaskMetaParam `config:"_,inline"` Tasks []*TrapConfig `config:"tasks"` }
TrapMetaConfig : associate task config
func (*TrapMetaConfig) GetTaskConfigList ¶
func (c *TrapMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type UDPTaskConfig ¶
type UDPTaskConfig struct { NetTaskParam `config:"_,inline"` SimpleMatchParam `config:"_,inline"` SimpleTaskParam `config:"_,inline"` Times int `config:"times" validate:"min=1"` WaitEmptyResponse bool `config:"wait_empty_response"` }
UDPTaskConfig :
type UDPTaskMetaConfig ¶
type UDPTaskMetaConfig struct { NetTaskMetaParam `config:"_,inline"` MaxTimes int `config:"max_times" validate:"min=1"` Tasks []*UDPTaskConfig `config:"tasks"` }
UDPTaskMetaConfig : udp task config
func NewUDPTaskMetaConfig ¶
func NewUDPTaskMetaConfig(root *Config) *UDPTaskMetaConfig
NewUDPTaskMetaConfig :
func (*UDPTaskMetaConfig) GetTaskConfigList ¶
func (c *UDPTaskMetaConfig) GetTaskConfigList() []define.TaskConfig
GetTaskConfigList :
type USMConfig ¶
type USMConfig struct { UserName string `config:"username"` AuthenticationProtocol string `config:"authentication_protocol"` AuthenticationPassphrase string `config:"authentication_passphrase"` PrivacyProtocol string `config:"privacy_protocol"` PrivacyPassphrase string `config:"privacy_passphrase"` AuthoritativeEngineBoots uint32 `config:"authoritative_engineboots"` AuthoritativeEngineTime uint32 `config:"authoritative_enginetime"` AuthoritativeEngineID string `config:"authoritative_engineID"` }
USMConfig snmp usm参数
Source Files ¶
- basereport.go
- basetaskparam.go
- childconfig.go
- config.go
- exceptionbeat.go
- gatherupbeat.go
- heartbeat.go
- httpconfig.go
- keywordsconfig.go
- kubeevent.go
- loginlog.go
- metricbeatconfig.go
- nettaskconfig.go
- pingconfig.go
- procbin.go
- procconf.go
- proccustom.go
- processbeat.go
- procsnapshot.go
- procstatus.go
- procsync.go
- rpmpackage.go
- scriptconfig.go
- shellhistory.go
- simpletaskconfig.go
- socketsnapshot.go
- staticconfig.go
- tcpconfig.go
- trapconfig.go
- udpconfig.go