config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OSVersionToString

func OSVersionToString(version OSVersion) string

OSVersionToString converts OSVersion to a string

Types

type Config

type Config struct {
	Devices map[string]*DeviceConfig `yaml:"devices,omitempty"`
}

Config provides means of reading the configuration file

func Load

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

Load loads the configuration from the given reader.

type DeviceConfig

type DeviceConfig struct {
	OSVersion         OSVersion
	Host              string
	Port              int      `yaml:"port,omitempty"`
	Username          string   `yaml:"username"`
	KeyFile           string   `yaml:"key_file,omitempty"`
	Password          string   `yaml:"password,omitempty"`
	ConnectTimeout    int      `yaml:"connect_timeout,omitempty"`
	CommandTimeout    int      `yaml:"command_timeout,omitempty"`
	EnabledCollectors []string `yaml:"enabled_collectors,flow"`
	Interfaces        []string `yaml:"interfaces,flow"`
}

DeviceConfig is used to read device configuration from the config file DeviceConfig describe how to connect to a remote device and what metrics to extract from the remote device.

type OSVersion

type OSVersion int

OSVersion is a type to refere to the remote device's operating system. Different parsers / commands might be needed due to differences in the Cisco CLI.

const (
	// INVALID The remote device's OS could not be fingerprinted.
	INVALID OSVersion = 0
	// IOSXE The remote device is running IOS XE.
	IOSXE OSVersion = 1
	// IOS The remote device is running IOS.
	IOS OSVersion = 2
	// NXOS The remote device is running NX OS.
	NXOS OSVersion = 3
)

Jump to

Keyboard shortcuts

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