types

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Network            string          `mapstructure:"network"`
	Port               uint16          `mapstructure:"port"`
	Version            string          `mapstructure:"version"`
	Timeout            int             `mapstructure:"timeout"`
	Retries            int             `mapstructure:"retries"`
	OidBatchSize       int             `mapstructure:"oid_batch_size"`
	Community          string          `mapstructure:"community"`
	User               string          `mapstructure:"user"`
	AuthKey            string          `mapstructure:"authentication_key"`
	AuthProtocol       string          `mapstructure:"authentication_protocol"`
	PrivKey            string          `mapstructure:"privacy_key"`
	PrivProtocol       string          `mapstructure:"privacy_protocol"`
	ContextEngineID    string          `mapstructure:"context_engine_id"`
	ContextName        string          `mapstructure:"context_name"`
	IgnoredIPAddresses map[string]bool `mapstructure:"ignored_ip_addresses"`
	ADIdentifier       string          `mapstructure:"ad_identifier"`
	Loader             string          `mapstructure:"loader"`
	Tags               []string        `mapstructure:"tags"`
}

Config holds configuration for a particular subnet

func (*Config) BuildSNMPParams

func (c *Config) BuildSNMPParams() (*gosnmp.GoSNMP, error)

BuildSNMPParams returns a valid GoSNMP struct to start making queries

func (*Config) Digest

func (c *Config) Digest(address string) string

Digest returns an hash value representing the data stored in this configuration, minus the network address

func (*Config) IsIPIgnored

func (c *Config) IsIPIgnored(ip net.IP) bool

IsIPIgnored checks the given IP against IgnoredIPAddresses

type ListenerConfig

type ListenerConfig struct {
	Workers           int      `mapstructure:"workers" yaml:"workers"`
	DiscoveryInterval int      `mapstructure:"discovery_interval" yaml:"discoveryInterval"`
	AllowedFailures   int      `mapstructure:"allowed_failures"`
	Configs           []Config `mapstructure:"configs"`
}

ListenerConfig holds global configuration for SNMP discovery

Jump to

Keyboard shortcuts

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