config

package
v0.0.0-...-421f662 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 4 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 {
	Debug         bool            `yaml:"debug"`
	LegacyCiphers bool            `yaml:"legacy_ciphers,omitempty"`
	Timeout       int             `yaml:"timeout,omitempty"`
	BatchSize     int             `yaml:"batch_size,omitempty"`
	Username      string          `yaml:"username,omitempty"`
	Password      string          `yaml:"Password,omitempty"`
	KeyFile       string          `yaml:"key_file,omitempty"`
	Devices       []*DeviceConfig `yaml:"devices,omitempty"`
	Features      *FeatureConfig  `yaml:"features,omitempty"`
}

Config represents the configuration for the exporter

func Load

func Load(reader io.Reader) (*Config, error)

Load loads a config from reader

func New

func New() *Config

New creates a new config

func (*Config) DevicesFromTargets

func (c *Config) DevicesFromTargets(sshHosts string)

DevicesFromTargets creates devices configs from targets list

func (*Config) FeaturesForDevice

func (c *Config) FeaturesForDevice(host string) *FeatureConfig

FeaturesForDevice gets the feature set configured for a device

type DeviceConfig

type DeviceConfig struct {
	Host          string         `yaml:"host"`
	Username      *string        `yaml:"username,omitempty"`
	Password      *string        `yaml:"password,omitempty"`
	KeyFile       *string        `yaml:"key_file,omitempty"`
	LegacyCiphers *bool          `yaml:"legacy_ciphers,omitempty"`
	Timeout       *int           `yaml:"timeout,omitempty"`
	BatchSize     *int           `yaml:"batch_size,omitempty"`
	Features      *FeatureConfig `yaml:"features,omitempty"`
}

DeviceConfig is the config representation of 1 device

type FeatureConfig

type FeatureConfig struct {
	BGP         *bool `yaml:"bgp,omitempty"`
	Environment *bool `yaml:"environment,omitempty"`
	Facts       *bool `yaml:"facts,omitempty"`
	Interfaces  *bool `yaml:"interfaces,omitempty"`
	Optics      *bool `yaml:"optics,omitempty"`
}

FeatureConfig is the list of collectors enabled or disabled

Jump to

Keyboard shortcuts

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