collector

package
v0.0.0-...-221c3f5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeFileIntegrationStatus

func ChangeFileIntegrationStatus(logTyp string, isEnabled bool) ([]string, error)

ChangeFileIntegrationStatus enables or disables a file-based integration.

func ChangeIntegrationStatus

func ChangeIntegrationStatus(logTyp string, proto string, isEnabled bool, tlsOptions ...bool) (string, error)

ChangeIntegrationStatus enables or disables an integration.

func CheckPortConfigured

func CheckPortConfigured(port string, proto string, cnf *schema.CollectorConfig, currentIntegration string) string

CheckPortConfigured checks if a port is configured (but not necessarily enabled) by another integration. Returns the integration name if configured, empty string otherwise.

func CheckPortConflict

func CheckPortConflict(port string, proto string, cnf *schema.CollectorConfig, currentIntegration string) string

CheckPortConflict checks if a port is in use by another enabled integration. Returns the integration name if there's a conflict, empty string otherwise.

func ConfigureFirstTime

func ConfigureFirstTime() error

ConfigureFirstTime is an alias for SyncCollectorConfig for backward compatibility. Deprecated: Use SyncCollectorConfig instead.

func DisableTLSForIntegration

func DisableTLSForIntegration(logTyp string, proto string) error

DisableTLSForIntegration disables TLS for an integration.

func EnableTLSForIntegration

func EnableTLSForIntegration(logTyp string, proto string) (string, error)

EnableTLSForIntegration enables TLS for an integration.

func GetFileIntegrationPaths

func GetFileIntegrationPaths(logTyp string) ([]string, error)

GetFileIntegrationPaths returns the configured paths for a file integration.

func InstallAll

func InstallAll() error

InstallAll installs all platform collectors that implement Installable.

func IsPortBindable

func IsPortBindable(port string, proto string) bool

IsPortBindable checks if the system can bind to a port.

func StartAll

func StartAll(ctx context.Context)

StartAll starts all collectors: platform-specific, syslog and netflow. The context is used for graceful shutdown signaling.

func StopAll

func StopAll()

StopAll stops all active collectors.

func SyncCollectorConfig

func SyncCollectorConfig() error

SyncCollectorConfig ensures the collector config file exists and is synchronized with the current ProtoPorts and FilePaths. It handles both initial creation and version upgrades: - If config doesn't exist → creates it with all integrations from ProtoPorts and FilePaths - If config exists → adds new integrations, removes obsolete ones

func UninstallAll

func UninstallAll() error

UninstallAll uninstalls all platform collectors that implement Installable.

Types

type ChangeFilePathsResult

type ChangeFilePathsResult struct {
	OldPaths []string
}

ChangeFilePathsResult contains the result of a path change operation.

func ChangeFilePaths

func ChangeFilePaths(logTyp string, paths []string) (ChangeFilePathsResult, error)

ChangeFilePaths changes the paths for a file-based integration.

type ChangePortResult

type ChangePortResult struct {
	OldPort string
	Warning string
}

ChangePortResult contains the result of a port change operation.

func ChangePort

func ChangePort(logTyp string, proto string, port string) (ChangePortResult, error)

ChangePort changes the port for an integration. Returns the old port and a warning if another integration has the same port configured.

type Collector

type Collector interface {
	Name() string
	Start(ctx context.Context, queue chan *plugins.Log)
	Stop()
}

Collector is the interface that every collector must implement.

type Installable

type Installable interface {
	Install() error
	Uninstall() error
}

Installable is an optional interface for collectors that install system services.

Directories

Path Synopsis
Package auditd provides a native collector for Linux Audit Framework events.
Package auditd provides a native collector for Linux Audit Framework events.
Package configwatcher provides a shared config file watcher using fsnotify.
Package configwatcher provides a shared config file watcher using fsnotify.
Package schema defines shared configuration types for collector packages.
Package schema defines shared configuration types for collector packages.

Jump to

Keyboard shortcuts

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