bgp

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCollector

func NewCollector() collector.Collector

NewCollector returns a new bgp.Collector instance

func Parse

func Parse(sshCtx *connector.SSHCommandContext, neighbors chan *Neighbor, done chan struct{})

Parse parses cli output and tries to find interfaces with related stats

Types

type Collector

type Collector struct {
}

Collector gathers metrics for BGP neighbors configured on the remote device by running * `show bgp ipv4 unicast neighbors` * `show bgp ipv6 unicast neighbors`

func (*Collector) Collect

func (c *Collector) Collect(ctx *collector.CollectContext)

Collect implements the collector.Collector interface's Collect function.

func (*Collector) Describe

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

Describe implements the collector.Collector interface's Describe function

func (*Collector) Name

func (*Collector) Name() string

Name implements the collector.Collector interface's Name function

type Neighbor

type Neighbor struct {
	RemoteAS    string
	RemoteIP    string
	Description string

	BGPVersion    float64
	State         string
	AdminShutdown float64

	HoldTime          float64
	KeepaliveInterval float64

	OpensSent         float64
	OpensRcvd         float64
	NotificationsSent float64
	NotificationsRcvd float64
	UpdatesSent       float64
	UpdatesRcvd       float64
	KeepalivesSent    float64
	KeepalivesRcvd    float64
	RouteRefreshsSent float64
	RouteRefreshsRcvd float64

	PrefixesCurrentBytes map[string]float64
	PrefixesCurrentRcvd  map[string]float64
	PrefixesCurrentSent  map[string]float64
	PrefixesTotalRcvd    map[string]float64
	PrefixesTotalSent    map[string]float64
	ImplicitWithdrawRcvd map[string]float64
	ImplicitWithdrawSent map[string]float64
	ExplicitWithdrawRcvd map[string]float64
	ExplicitWithdrawSent map[string]float64
	UsedAsBestpath       map[string]float64
	UsedAsMultipath      map[string]float64
	UsedAsSecondary      map[string]float64

	ConnectionsEstablished float64
	ConnectionsDropped     float64

	Uptime float64
}

Neighbor is a representation of the Cisco CLI ouputs concerning a BGP neigbor.

func NewNeighbor

func NewNeighbor() *Neighbor

NewNeighbor returns a new bgp.Neighbor and initializes some fields

Jump to

Keyboard shortcuts

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