exporter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExporterName

func GetExporterName() string

GetExporterName returns exporter name.

func GetRevision

func GetRevision() string

GetRevision returns exporter revision.

func GetVersion

func GetVersion() string

GetVersion returns exporter version.

func GetVersionBuildContext

func GetVersionBuildContext() string

GetVersionBuildContext returns exporter build context.

func GetVersionInfo

func GetVersionInfo() string

GetVersionInfo returns exporter info.

Types

type Exporter

type Exporter struct {
	sync.RWMutex

	InventoryFile string
	VaultFile     string
	VaultKeyFile  string
	Inventory     *ansible.Inventory
	Vault         *ansible.Vault
	Modules       map[string]bool
	Subsystems    map[string]bool
	Nodes         map[string]*NetworkNode
	Tokens        map[string]bool
	// contains filtered or unexported fields
}

Exporter holds the inventory and credentials for accessing network nodes. It also contains exporters for each of the nodes.

func NewExporter

func NewExporter(opts Options) (*Exporter, error)

NewExporter returns an initialized Exporter.

func (*Exporter) AddAuthenticationToken

func (e *Exporter) AddAuthenticationToken(s string) error

AddAuthenticationToken adds an authentication token for accessing the exporter itself.

func (*Exporter) GetPollInterval

func (e *Exporter) GetPollInterval() int64

GetPollInterval returns exporters minimal polling/scraping interval.

func (*Exporter) Scrape

func (e *Exporter) Scrape(w http.ResponseWriter, r *http.Request)

Scrape scrapes individual nodes.

func (*Exporter) SetPollInterval

func (e *Exporter) SetPollInterval(i int64)

SetPollInterval sets exporter's minimal polling/scraping interval.

func (*Exporter) Summary

func (e *Exporter) Summary(p string, w http.ResponseWriter, r *http.Request)

Summary returns the content of the Exporter's default page.

type NetworkNode

type NetworkNode struct {
	sync.RWMutex
	Name       string
	UUID       string
	Variables  map[string]string
	Interfaces map[string]string
	Vlans      map[string]string
	// contains filtered or unexported fields
}

NetworkNode is an instance of a managed network node, e.g. a router or switch.

func (*NetworkNode) Collect

func (n *NetworkNode) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*NetworkNode) Describe

func (n *NetworkNode) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by the exporter. It implements prometheus.Collector.

func (*NetworkNode) GatherMetrics

func (n *NetworkNode) GatherMetrics()

GatherMetrics collect data from a network node and stores them as Prometheus metrics.

func (*NetworkNode) GetInterfaces

func (n *NetworkNode) GetInterfaces(cli *api.Client)

GetInterfaces collects interface related metrics.

func (*NetworkNode) GetMetricsTable

func (n *NetworkNode) GetMetricsTable() string

GetMetricsTable returns markdown-formatted table with the name, help, and labels of the metrics produced by the exporter.

func (*NetworkNode) GetRoutingBgp

func (n *NetworkNode) GetRoutingBgp(cli *api.Client)

GetRoutingBgp collects BGP routing related metrics.

func (*NetworkNode) GetSystemEnvironment

func (n *NetworkNode) GetSystemEnvironment(cli *api.Client)

GetSystemEnvironment collects system environment related metrics, e.g. fans, power supplies, sensors, etc.

func (*NetworkNode) GetSystemResources

func (n *NetworkNode) GetSystemResources(cli *api.Client)

GetSystemResources collects system resource usage metrics. That includes data about CPU, memory, and processes.

func (*NetworkNode) GetTransceivers

func (n *NetworkNode) GetTransceivers(cli *api.Client)

GetTransceivers collects interface fiber transceiver related metrics.

func (*NetworkNode) GetVlans

func (n *NetworkNode) GetVlans(cli *api.Client)

GetVlans collects VLAN related metrics.

func (*NetworkNode) IncrementErrorCounter

func (n *NetworkNode) IncrementErrorCounter()

IncrementErrorCounter increases the counter of failed queries to a network node.

type Options

type Options struct {
	Timeout       int
	InventoryFile string
	VaultFile     string
	VaultKeyFile  string
}

Options are the options for the initialization of an instance of the Exporter.

Jump to

Keyboard shortcuts

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