-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: disable field concatenation for gnmi (#1078)
* chore: disable field concatenation for gnmi * chore: interface example for gnmi
- Loading branch information
1 parent
185474f
commit 164094c
Showing
4 changed files
with
240 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
#interval="5s" | ||
# gNMI telemetry input plugin | ||
# [[instances]] | ||
## Address and port of the gNMI GRPC server | ||
# addresses = [] | ||
|
||
## define credentials | ||
username = "admin" | ||
password = "admin" | ||
|
||
## gNMI encoding requested (one of: "proto", "json", "json_ietf", "bytes") | ||
encoding = "json" | ||
|
||
## redial in case of failures after | ||
redial = "10s" | ||
|
||
## gRPC Maximum Message Size | ||
max_msg_size = 4194304 | ||
|
||
## Enable to get the canonical path as field-name | ||
# canonical_field_names = false | ||
|
||
## Remove leading slashes and dots in field-name | ||
# trim_field_names = false | ||
|
||
## Guess the path-tag if an update does not contain a prefix-path | ||
## If enabled, the common-path of all elements in the update is used. | ||
# guess_path_tag = false | ||
|
||
## enable client-side TLS and define CA to authenticate the device | ||
# enable_tls = true | ||
# tls_ca = "/etc/categraf/ca.pem" | ||
## Minimal TLS version to accept by the client | ||
# tls_min_version = "TLS12" | ||
## Use TLS but skip chain & host verification | ||
# insecure_skip_verify = true | ||
|
||
## define client-side TLS certificate & key to authenticate to the device | ||
# tls_cert = "/etc/categraf/cert.pem" | ||
# tls_key = "/etc/categraf/key.pem" | ||
|
||
## gNMI subscription prefix (optional, can usually be left empty) | ||
## See: https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#222-paths | ||
# origin = "" | ||
# prefix = "" | ||
# target = "" | ||
|
||
## Vendor specific options | ||
## This defines what vendor specific options to load. | ||
## * Juniper Header Extension (juniper_header): some sensors are directly managed by | ||
## Linecard, which adds the Juniper GNMI Header Extension. Enabling this | ||
## allows the decoding of the Extension header if present. Currently this knob | ||
## adds component, component_id & sub_component_id as additionnal tags | ||
# vendor_specific = [] | ||
|
||
## Define additional aliases to map encoding paths to measurement names | ||
#[instances.aliases] | ||
# incomming = "openconfig:/interfaces/interface/state/counters/in-octets" | ||
# incomming_ucastpkgts = "openconfig:/interfaces/interface/state/counters/in-unicast-pkts" | ||
# incomming_errors = "openconfig:/interfaces/interface/state/counters/in-errors" | ||
# outgoing = "openconfig:/interfaces/interface/state/counters/out-octets" | ||
# outgoing_ucastpkts = "openconfig:/interfaces/interface/state/counters/out-unicast-pkts" | ||
# outgoing_errors = "openconfig:/interfaces/interface/state/counters/out-errors" | ||
# ifname = "openconfig:/interfaces/interface/state/name" | ||
# ifalias = "openconfig:/interfaces/interface/config/description" | ||
# type = "openconfig:/interfaces/interface/state/type" | ||
# ostatus = "openconfig:/interfaces/interface/state/oper-status" | ||
# speed = "openconfig:/interfaces/interface/ethernet/state/port-speed" | ||
|
||
[[instances.subscription]] | ||
name = "gnmi_interface_incomming" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/in-octets" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_incoming_errors" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/in-errors" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_incomming_ucastpkts" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/in-unicast-pkts" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_outgoing" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/out-octets" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_outgoing_errors" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/out-errors" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_outgoing_ucastpkts" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/counters/out-unicast-pkts" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_admin_status" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/admin-status" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_ostatus" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/state/oper-status" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
[[instances.subscription]] | ||
name = "gnmi_interface_speed" | ||
origin = "openconfig" | ||
path = "/interfaces/interface/ethernet/state/port-speed" | ||
subscription_mode = "sample" | ||
sample_interval = "15s" | ||
disable_concatenation = true | ||
|
||
|
||
#[[instances.subscription]] | ||
## Name of the measurement that will be emitted | ||
#name = "gnmi" | ||
|
||
## Origin and path of the subscription | ||
## See: https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#222-paths | ||
## | ||
## 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: | ||
## https://github.com/YangModels/yang/tree/master/vendor/cisco/xr | ||
#origin = "openconfig" | ||
#path = "/interfaces/interface/state/counters" #/in-octets" | ||
|
||
## Subscription mode ("target_defined", "sample", "on_change") and interval | ||
#subscription_mode = "sample" | ||
#sample_interval = "15s" | ||
|
||
## Suppress redundant transmissions when measured values are unchanged | ||
#suppress_redundant = true | ||
|
||
## If suppression is enabled, send updates at least every X seconds anyway | ||
#heartbeat_interval = "15s" | ||
[[instances.tag_subscription]] | ||
name = "ifname" | ||
origin = "" | ||
path = "/interfaces/interface/state/name" | ||
subscription_mode = "on_change" | ||
match = "name" | ||
#elements = ["name"] | ||
disable_concatenation = true | ||
|
||
[[instances.tag_subscription]] | ||
name = "type" | ||
origin = "" | ||
path = "/interfaces/interface/state/type" | ||
subscription_mode = "on_change" | ||
match = "name" | ||
#elements = ["interface"] | ||
disable_concatenation = true | ||
|
||
[[instances.tag_subscription]] | ||
name = "ifalias" | ||
origin = "" | ||
path = "/interfaces/interface/state/description" | ||
subscription_mode = "on_change" | ||
match = "elements" | ||
elements = ["interface"] | ||
disable_concatenation = true | ||
|
||
|
||
[[instances.processor_enum]] | ||
metrics = ["*status"] | ||
[instances.processor_enum.value_mappings] | ||
UP = 1 | ||
DOWN = 0 | ||
NOT_PRESENT = -1 | ||
|
||
[[instances.processor_enum]] | ||
metrics = ["*speed"] | ||
[instances.processor_enum.value_mappings] | ||
"openconfig-if-ethernet:SPEED_25GB" = 25000000000 | ||
"openconfig-if-ethernet:SPEED_50GB" = 50000000000 | ||
"openconfig-if-ethernet:SPEED_100GB" = 100000000000 | ||
"openconfig-if-ethernet:SPEED_200GB" = 200000000000 | ||
"openconfig-if-ethernet:SPEED_UNKNOWN" = -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters