v0.0.0-...-16a0e24 Latest Latest

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 22 Imported by: 0


Cisco GNMI Telemetry

Cisco GNMI Telemetry is an input plugin that consumes telemetry data based on the GNMI Subscribe method. TLS is supported for authentication and encryption.

It has been optimized to support GNMI telemetry as produced by Cisco IOS XR (64-bit) version 6.5.1, Cisco NX-OS 9.3 and Cisco IOS XE 16.12 and later.

  ## Address and port of the GNMI GRPC server
  addresses = [""]

  ## define credentials
  username = "cisco"
  password = "cisco"

  ## GNMI encoding requested (one of: "proto", "json", "json_ietf")
  # encoding = "proto"

  ## redial in case of failures after
  redial = "10s"

  ## enable client-side TLS and define CA to authenticate the device
  # enable_tls = true
  # tls_ca = "/etc/telegraf/ca.pem"
  # insecure_skip_verify = true

  ## define client-side TLS certificate & key to authenticate to the device
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"

  ## GNMI subscription prefix (optional, can usually be left empty)
  ## See:
  # origin = ""
  # prefix = ""
  # target = ""

  ## Define additional aliases to map telemetry encoding paths to simple measurement names
  # [inputs.cisco_telemetry_gnmi.aliases]
  #   ifcounters = "openconfig:/interfaces/interface/state/counters"

    ## Name of the measurement that will be emitted
    name = "ifcounters"

    ## Origin and path of the subscription
    ## See:
    ## origin usually refers to a (YANG) data model implemented by the device
    ## and path to a specific substructure inside it that should be subscribed to (similar to an XPath)
    ## YANG models can be found e.g. here:
    origin = "openconfig-interfaces"
    path = "/interfaces/interface/state/counters"

    # Subscription mode (one of: "target_defined", "sample", "on_change") and interval
    subscription_mode = "sample"
    sample_interval = "10s"

    ## Suppress redundant transmissions when measured values are unchanged
    # suppress_redundant = false

    ## If suppression is enabled, send updates at least every X seconds anyway
    # heartbeat_interval = "60s"
Example Output
ifcounters,path=openconfig-interfaces:/interfaces/interface/state/counters,host=linux,name=MgmtEth0/RP0/CPU0/0,source= in-multicast-pkts=0i,out-multicast-pkts=0i,out-errors=0i,out-discards=0i,in-broadcast-pkts=0i,out-broadcast-pkts=0i,in-discards=0i,in-unknown-protos=0i,in-errors=0i,out-unicast-pkts=0i,in-octets=0i,out-octets=0i,last-clear="2019-05-22T16:53:21Z",in-unicast-pkts=0i 1559145777425000000
ifcounters,path=openconfig-interfaces:/interfaces/interface/state/counters,host=linux,name=GigabitEthernet0/0/0/0,source= out-multicast-pkts=0i,out-broadcast-pkts=0i,in-errors=0i,out-errors=0i,in-discards=0i,out-octets=0i,in-unknown-protos=0i,in-unicast-pkts=0i,in-octets=0i,in-multicast-pkts=0i,in-broadcast-pkts=0i,last-clear="2019-05-22T16:54:50Z",out-unicast-pkts=0i,out-discards=0i 1559145777425000000




This section is empty.


This section is empty.


This section is empty.


type CiscoTelemetryGNMI

type CiscoTelemetryGNMI struct {
	Addresses     []string          `toml:"addresses"`
	Subscriptions []Subscription    `toml:"subscription"`
	Aliases       map[string]string `toml:"aliases"`

	// Optional subscription configuration
	Encoding    string
	Origin      string
	Prefix      string
	Target      string
	UpdatesOnly bool `toml:"updates_only"`

	// Cisco IOS XR credentials
	Username string
	Password string

	// Redial
	Redial internal.Duration

	// GRPC TLS settings
	EnableTLS bool `toml:"enable_tls"`

	Log telegraf.Logger
	// contains filtered or unexported fields

CiscoTelemetryGNMI plugin instance

func (*CiscoTelemetryGNMI) Description

func (c *CiscoTelemetryGNMI) Description() string

Description of plugin

func (*CiscoTelemetryGNMI) Gather

func (c *CiscoTelemetryGNMI) Gather(_ telegraf.Accumulator) error

Gather plugin measurements (unused)

func (*CiscoTelemetryGNMI) SampleConfig

func (c *CiscoTelemetryGNMI) SampleConfig() string

SampleConfig of plugin

func (*CiscoTelemetryGNMI) Start

func (c *CiscoTelemetryGNMI) Start(acc telegraf.Accumulator) error

Start the http listener service

func (*CiscoTelemetryGNMI) Stop

func (c *CiscoTelemetryGNMI) Stop()

Stop listener and cleanup

type Subscription

type Subscription struct {
	Name   string
	Origin string
	Path   string

	// Subscription mode and interval
	SubscriptionMode string            `toml:"subscription_mode"`
	SampleInterval   internal.Duration `toml:"sample_interval"`

	// Duplicate suppression
	SuppressRedundant bool              `toml:"suppress_redundant"`
	HeartbeatInterval internal.Duration `toml:"heartbeat_interval"`

Subscription for a GNMI client

Jump to

Keyboard shortcuts

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