Documentation ¶
Overview ¶
Package config implements the configuration type for the traps server and a component that provides it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TrapsConfig ¶
type TrapsConfig struct { Enabled bool `mapstructure:"enabled" yaml:"enabled"` Port uint16 `mapstructure:"port" yaml:"port"` Users []UserV3 `mapstructure:"users" yaml:"users"` CommunityStrings []string `mapstructure:"community_strings" yaml:"community_strings"` BindHost string `mapstructure:"bind_host" yaml:"bind_host"` StopTimeout int `mapstructure:"stop_timeout" yaml:"stop_timeout"` Namespace string `mapstructure:"namespace" yaml:"namespace"` // contains filtered or unexported fields }
TrapsConfig contains configuration for SNMP trap listeners. YAML field tags provided for test marshalling purposes.
func ReadConfig ¶
func ReadConfig(host string, conf config.Component) (*TrapsConfig, error)
ReadConfig builds the traps configuration from the Agent configuration.
func (*TrapsConfig) Addr ¶
func (c *TrapsConfig) Addr() string
Addr returns the host:port address to listen on.
func (*TrapsConfig) BuildSNMPParams ¶
BuildSNMPParams returns a valid GoSNMP params structure from configuration.
func (*TrapsConfig) GetPacketChannelSize ¶
func (c *TrapsConfig) GetPacketChannelSize() int
GetPacketChannelSize returns the default size for the packets channel
func (*TrapsConfig) SetDefaults ¶
func (c *TrapsConfig) SetDefaults(host string, namespace string) error
SetDefaults sets all unset values to default values, and returns an error if any fields are invalid.
type UserV3 ¶
type UserV3 struct { Username string `mapstructure:"user" yaml:"user"` UsernameLegacy string `mapstructure:"username" yaml:"username"` AuthKey string `mapstructure:"authKey" yaml:"authKey"` AuthProtocol string `mapstructure:"authProtocol" yaml:"authProtocol"` PrivKey string `mapstructure:"privKey" yaml:"privKey"` PrivProtocol string `mapstructure:"privProtocol" yaml:"privProtocol"` }
UserV3 contains the definition of one SNMPv3 user with its username and its auth parameters.
Directories ¶
Path | Synopsis |
---|---|
Package configimpl implements the config service.
|
Package configimpl implements the config service. |