Documentation ¶
Index ¶
- func FindPidsByCmdlineGrep(prefix string, process string) ([]int, error)
- func FindSocketsOfPid(prefix string, pid int) (inodes []int64, err error)
- type PortProcMapping
- type ProcConfig
- type Process
- type ProcessesWatcher
- func (proc *ProcessesWatcher) FindProc(port uint16) (procname string)
- func (proc *ProcessesWatcher) FindProcessesTuple(tuple *common.IpPortTuple) (proc_tuple *common.CmdlineTuple)
- func (proc *ProcessesWatcher) Init(config ProcsConfig) error
- func (proc *ProcessesWatcher) IsLocalIp(ip net.IP) bool
- func (proc *ProcessesWatcher) UpdateMap()
- func (proc *ProcessesWatcher) UpdateMappingEntry(port uint16, pid int, p *Process)
- type ProcsConfig
- type SocketInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPidsByCmdlineGrep ¶
Types ¶
type PortProcMapping ¶
type ProcConfig ¶
type Process ¶
type Process struct { Name string Grepper string Pids []int RefreshPidsTimer <-chan time.Time // contains filtered or unexported fields }
func NewProcess ¶
func (*Process) RefreshPids ¶
func (p *Process) RefreshPids()
type ProcessesWatcher ¶
type ProcessesWatcher struct { PortProcMap map[uint16]PortProcMapping LastMapUpdate time.Time Processes []*Process LocalAddrs []net.IP // config ReadFromProc bool MaxReadFreq time.Duration RefreshPidsFreq time.Duration TestSignals *chan bool // contains filtered or unexported fields }
var ProcWatcher ProcessesWatcher
func (*ProcessesWatcher) FindProc ¶
func (proc *ProcessesWatcher) FindProc(port uint16) (procname string)
func (*ProcessesWatcher) FindProcessesTuple ¶
func (proc *ProcessesWatcher) FindProcessesTuple(tuple *common.IpPortTuple) (proc_tuple *common.CmdlineTuple)
func (*ProcessesWatcher) Init ¶
func (proc *ProcessesWatcher) Init(config ProcsConfig) error
func (*ProcessesWatcher) UpdateMap ¶
func (proc *ProcessesWatcher) UpdateMap()
func (*ProcessesWatcher) UpdateMappingEntry ¶
func (proc *ProcessesWatcher) UpdateMappingEntry(port uint16, pid int, p *Process)
type ProcsConfig ¶
type ProcsConfig struct { Enabled bool Max_proc_read_freq int Monitored []ProcConfig Refresh_pids_freq int }
type SocketInfo ¶
func Parse_Proc_Net_Tcp ¶
func Parse_Proc_Net_Tcp(input io.Reader) ([]*SocketInfo, error)
Parses the /proc/net/tcp file
Click to show internal directories.
Click to hide internal directories.