monitor

package
v0.0.0-...-8ec60ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPGet

type HTTPGet struct {
	// contains filtered or unexported fields
}

HTTPGet manages the goroutines responsible for collecting HTTPGet data

func NewHTTPGet

func NewHTTPGet(logger log.Logger, sc *config.SafeConfig, resolver *config.Resolver) *HTTPGet

NewHTTPGet creates and configures a new Monitoring HTTPGet instance

func (*HTTPGet) AddTarget

func (p *HTTPGet) AddTarget(name string, url string, srcAddr string, proxy string, labels map[string]string) (err error)

AddTarget adds a target to the monitored list

func (*HTTPGet) AddTargetDelayed

func (p *HTTPGet) AddTargetDelayed(name string, urlStr string, srcAddr string, proxy string, labels map[string]string, startupDelay time.Duration) (err error)

AddTargetDelayed is AddTarget with a startup delay

func (*HTTPGet) AddTargets

func (p *HTTPGet) AddTargets()

AddTargets adds newly added targets from the configuration

func (*HTTPGet) DelTargets

func (p *HTTPGet) DelTargets()

DelTargets deletes/stops the removed targets from the configuration

func (*HTTPGet) ExportLabels

func (p *HTTPGet) ExportLabels() map[string]map[string]string

ExportLabels target labels

func (*HTTPGet) ExportMetrics

func (p *HTTPGet) ExportMetrics() map[string]*http.HTTPReturn

Export collects the metrics for each monitored target and returns it as a simple map

func (*HTTPGet) RemoveTarget

func (p *HTTPGet) RemoveTarget(key string)

RemoveTarget removes a target from the monitoring list

func (*HTTPGet) Stop

func (p *HTTPGet) Stop()

Stop brings the monitoring gracefully to a halt

type MTR

type MTR struct {
	// contains filtered or unexported fields
}

MTR manages the goroutines responsible for collecting MTR data

func NewMTR

func NewMTR(logger log.Logger, sc *config.SafeConfig, resolver *config.Resolver, icmpID *common.IcmpID) *MTR

NewMTR creates and configures a new Monitoring MTR instance

func (*MTR) AddTarget

func (p *MTR) AddTarget(name string, host string, srcAddr string, labels map[string]string) (err error)

AddTarget adds a target to the monitored list

func (*MTR) AddTargetDelayed

func (p *MTR) AddTargetDelayed(name string, host string, srcAddr string, labels map[string]string, startupDelay time.Duration) (err error)

AddTargetDelayed is AddTarget with a startup delay

func (*MTR) AddTargets

func (p *MTR) AddTargets()

AddTargets adds newly added targets from the configuration

func (*MTR) CheckActiveTargets

func (p *MTR) CheckActiveTargets() (err error)

Read target if IP was changed (DNS record)

func (*MTR) DelTargets

func (p *MTR) DelTargets()

DelTargets deletes/stops the removed targets from the configuration

func (*MTR) ExportLabels

func (p *MTR) ExportLabels() map[string]map[string]string

ExportLabels target labels

func (*MTR) ExportMetrics

func (p *MTR) ExportMetrics() map[string]*mtr.MtrResult

ExportMetrics collects the metrics for each monitored target and returns it as a simple map

func (*MTR) RemoveTarget

func (p *MTR) RemoveTarget(key string)

RemoveTarget removes a target from the monitoring list

func (*MTR) Stop

func (p *MTR) Stop()

Stop brings the monitoring gracefully to a halt

type PING

type PING struct {
	// contains filtered or unexported fields
}

PING manages the goroutines responsible for collecting ICMP data

func NewPing

func NewPing(logger log.Logger, sc *config.SafeConfig, resolver *config.Resolver, icmpID *common.IcmpID) *PING

NewPing creates and configures a new Monitoring ICMP instance

func (*PING) AddTarget

func (p *PING) AddTarget(name string, host string, ip string, srcAddr string, labels map[string]string) (err error)

AddTarget adds a target to the monitored list

func (*PING) AddTargetDelayed

func (p *PING) AddTargetDelayed(name string, host string, ip string, srcAddr string, labels map[string]string, startupDelay time.Duration) (err error)

AddTargetDelayed is AddTarget with a startup delay

func (*PING) AddTargets

func (p *PING) AddTargets()

AddTargets adds newly added targets from the configuration

func (*PING) CheckActiveTargets

func (p *PING) CheckActiveTargets() (err error)

Read target if IP was changed (DNS record)

func (*PING) DelTargets

func (p *PING) DelTargets()

DelTargets deletes/stops the removed targets from the configuration

func (*PING) ExportLabels

func (p *PING) ExportLabels() map[string]map[string]string

ExportLabels target labels

func (*PING) ExportMetrics

func (p *PING) ExportMetrics() map[string]*ping.PingResult

ExportMetrics collects the metrics for each monitored target and returns it as a simple map

func (*PING) RemoveTarget

func (p *PING) RemoveTarget(key string)

RemoveTarget removes a target from the monitoring list

func (*PING) Stop

func (p *PING) Stop()

Stop brings the monitoring gracefully to a halt

type TCPPort

type TCPPort struct {
	// contains filtered or unexported fields
}

TCPPort manages the goroutines responsible for collecting TCP data

func NewTCPPort

func NewTCPPort(logger log.Logger, sc *config.SafeConfig, resolver *config.Resolver) *TCPPort

NewTCPPort creates and configures a new Monitoring TCP instance

func (*TCPPort) AddTarget

func (p *TCPPort) AddTarget(name string, host string, ip string, srcAddr string, port string, labels map[string]string) (err error)

AddTarget adds a target to the monitored list

func (*TCPPort) AddTargetDelayed

func (p *TCPPort) AddTargetDelayed(name string, host string, ip string, srcAddr string, port string, labels map[string]string, startupDelay time.Duration) (err error)

AddTargetDelayed is AddTarget with a startup delay

func (*TCPPort) AddTargets

func (p *TCPPort) AddTargets()

AddTargets adds newly added targets from the configuration

func (*TCPPort) CheckActiveTargets

func (p *TCPPort) CheckActiveTargets() (err error)

Read target if IP was changed (DNS record)

func (*TCPPort) DelTargets

func (p *TCPPort) DelTargets()

DelTargets deletes/stops the removed targets from the configuration

func (*TCPPort) ExportLabels

func (p *TCPPort) ExportLabels() map[string]map[string]string

ExportLabels target labels

func (*TCPPort) ExportMetrics

func (p *TCPPort) ExportMetrics() map[string]*tcp.TCPPortReturn

ExportMetrics collects the metrics for each monitored target and returns it as a simple map

func (*TCPPort) RemoveTarget

func (p *TCPPort) RemoveTarget(key string)

RemoveTarget removes a target from the monitoring list

func (*TCPPort) Stop

func (p *TCPPort) Stop()

Stop brings the monitoring gracefully to a halt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL