Documentation ¶
Index ¶
- Constants
- Variables
- func IsIpv6(s string) bool
- type ConnDetector
- type FileSocket
- type NetlinkDetector
- type PidSockets
- type PortConfigStore
- type PortStat
- type PortStats
- type ProcCollector
- func (pc *ProcCollector) AsOneCmdbConfMapStr(stat define.ProcStat) common.MapStr
- func (pc *ProcCollector) CollectPortStat(pcs PortConfigStore) (PortStats, error)
- func (pc *ProcCollector) CollectProcStat(metas []define.ProcStat) ([]common.MapStr, []common.MapStr, PortConfigStore)
- func (pc *ProcCollector) GetAllMetaData() ([]define.ProcStat, error)
- func (pc *ProcCollector) GetOneMetaData(pid int32) (define.ProcStat, error)
- func (pc *ProcCollector) GetOnePerfStat(pid int32) (define.ProcStat, error)
- func (pc *ProcCollector) MergeMetaDataPerfStat(meta, perf define.ProcStat) define.ProcStat
- func (pc *ProcCollector) Snapshot() ([]define.ProcStat, int64, error)
- func (pc *ProcCollector) UpdateConf(conf *configs.ProcessbeatConfig)
- type StateType
- type StdDetector
Constants ¶
View Source
const ( ProtocolUnspecified = "" ProtocolTCP = "tcp" ProtocolUDP = "udp" ProtocolTCP6 = "tcp6" ProtocolUDP6 = "udp6" DetectorStd = "std" DetectorNetlink = "netlink" )
Variables ¶
View Source
var ErrSkipCollect = errors.New("skip collect")
View Source
var ProcCustomPerfCollector = NewProcCollector()
Functions ¶
Types ¶
type ConnDetector ¶
type ConnDetector interface { Type() string Get(pids []int32) (PidSockets, error) GetState(pids []int32, state StateType) (PidSockets, error) }
type FileSocket ¶
type FileSocket struct { Status string Inode uint32 Type int Pid int32 Family uint32 Saddr string Sport uint32 Daddr string Dport uint32 Protocol string }
func (FileSocket) Listen ¶
func (fs FileSocket) Listen() string
type NetlinkDetector ¶
type NetlinkDetector struct{}
func (NetlinkDetector) Get ¶
func (d NetlinkDetector) Get(pids []int32) (PidSockets, error)
func (NetlinkDetector) GetState ¶
func (d NetlinkDetector) GetState(pids []int32, state StateType) (PidSockets, error)
func (NetlinkDetector) Type ¶
func (d NetlinkDetector) Type() string
type PidSockets ¶
type PidSockets struct { TCP map[int32][]FileSocket UDP map[int32][]FileSocket TCP6 map[int32][]FileSocket UDP6 map[int32][]FileSocket }
func NewPidSockets ¶
func NewPidSockets() PidSockets
func (PidSockets) Get ¶
func (ps PidSockets) Get(pid int32, protocol string) []FileSocket
Get 获取指定 protocol 的 FileSocket 既要支持 ipv6 新场景的 也要兼容原先的 tcp/udp 检测逻辑
type PortConfigStore ¶
type PortStat ¶
type PortStat struct { ProcName string `json:"name"` Status int `json:"exists"` Protocol string `json:"protocol"` Listen []uint16 `json:"listen"` NonListen []uint16 `json:"nonlisten"` NotAccurateListen []string `json:"notaccuratelisten"` BindIP string `json:"bindip"` ParamRegex string `json:"paramregex"` DisplayName string `json:"displayname"` PortHealthy int `json:"porthealth"` }
type ProcCollector ¶
type ProcCollector struct {
// contains filtered or unexported fields
}
func NewProcCollector ¶
func NewProcCollector() *ProcCollector
func (*ProcCollector) AsOneCmdbConfMapStr ¶
func (pc *ProcCollector) AsOneCmdbConfMapStr(stat define.ProcStat) common.MapStr
func (*ProcCollector) CollectPortStat ¶
func (pc *ProcCollector) CollectPortStat(pcs PortConfigStore) (PortStats, error)
func (*ProcCollector) CollectProcStat ¶
func (pc *ProcCollector) CollectProcStat(metas []define.ProcStat) ([]common.MapStr, []common.MapStr, PortConfigStore)
CollectProcStat collects process performance statistics
func (*ProcCollector) GetAllMetaData ¶
func (pc *ProcCollector) GetAllMetaData() ([]define.ProcStat, error)
func (*ProcCollector) GetOneMetaData ¶
func (pc *ProcCollector) GetOneMetaData(pid int32) (define.ProcStat, error)
func (*ProcCollector) GetOnePerfStat ¶
func (pc *ProcCollector) GetOnePerfStat(pid int32) (define.ProcStat, error)
func (*ProcCollector) MergeMetaDataPerfStat ¶
func (pc *ProcCollector) MergeMetaDataPerfStat(meta, perf define.ProcStat) define.ProcStat
func (*ProcCollector) Snapshot ¶
func (pc *ProcCollector) Snapshot() ([]define.ProcStat, int64, error)
func (*ProcCollector) UpdateConf ¶
func (pc *ProcCollector) UpdateConf(conf *configs.ProcessbeatConfig)
type StdDetector ¶
type StdDetector struct{}
func (StdDetector) Get ¶
func (d StdDetector) Get(pids []int32) (PidSockets, error)
func (StdDetector) GetState ¶
func (d StdDetector) GetState(pids []int32, state StateType) (PidSockets, error)
func (StdDetector) Type ¶
func (d StdDetector) Type() string
Click to show internal directories.
Click to hide internal directories.