Skip to content

Instantly share code, notes, and snippets.

@lukebigum
Created May 25, 2018 12:22
Show Gist options
  • Save lukebigum/725e46c18f06f6b4053409ff3d21e43f to your computer and use it in GitHub Desktop.
Save lukebigum/725e46c18f06f6b4053409ff3d21e43f to your computer and use it in GitHub Desktop.
[user@host ~]$ influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
> use lanz
Using database lanz
> select * from congestion_record order by time desc limit 10
name: congestion_record
time entry_type host hostname intf_name port port_id q_drop_count queue_size switch_id time_of_max_qlen timestamp traffic_class tx_latency
---- ---------- ---- -------- --------- ---- ------- ------------ ---------- --------- ---------------- --------- ------------- ----------
1527250808255589742 3 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080820836 1 5790
1527250808255579124 1 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080820833 1 5790
1527250808255543779 3 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080818139 1 5790
1527250808255528244 1 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080818136 1 5790
1527250808165416882 3 xxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzz Ethernet35 50001 33 0 23 0 0 152725080810881 1 5992
1527250808165365014 1 xxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzz Ethernet35 50001 33 0 23 0 0 152725080810872 1 5992
1527250808165231424 3 xxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzz Ethernet35 50001 33 0 15 0 0 152725080804796 1 3813
1527250808162041175 1 xxxxxxxxxxxxxxxxxxx zzzzzzzzzzzzzzzzzzzz Ethernet35 50001 33 0 15 0 0 152725080804793 1 3813
1527250808161502002 3 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080806426 1 5790
1527250808161448866 1 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080806423 1 5790
@lukebigum
Copy link
Author

Sample Grafana dashboard showing the data
lanz

@lukebigum
Copy link
Author

Example Telegraf config:

[global_tags]
[agent]
  interval = "1s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
  debug = false
  quiet = false
  logfile = ""
  hostname = ""
  omit_hostname = false
[[outputs.elasticsearch]]
  urls = ["http://localhost:9200"]
  index_name = "lanz-%Y.%m.%d"
  manage_template = true
  template_name = "telegraf"
[[outputs.influxdb]]
  urls = ["http://localhost:8086"]
  database = "lanz"
  password = "lanz"
  precision = "ns"
  retention_policy = ""
  username = "lanz"
[[inputs.lanz_consumer]]
  servers = [
    "tcp://switch1.example.com:50001",
    "tcp://switch2.example.com:50001",
  ]

@littlespace
Copy link

I just wanted to see if you can share the code and also if you were able to get the gRPC working on Arista with telegraf?

@timhughes
Copy link

@littlespace
Copy link

@timhughes I tried it in my lab but I do not see any data coming in. I did not get any error when I was building the telegraf and LANZ is enable on the switch. I also see the client is connected to the switch but I do not see any data coming in.

@timhughes
Copy link

@littlespace

Do you get any errors. Can you paste your configs for telegraf and settings for lanz and firmware version for the switch?

Just in case your build hasn't picked up the plugin, this is how I build it.

rm -rf $(go env GOPATH)/src/github.com/influxdata/telegraf
mkdir -p $(go env GOPATH)/src/github.com/influxdata/
cd $(go env GOPATH)/src/github.com/influxdata/
git clone https://github.com/timhughes/telegraf
git checkout lanz_consumer_multi_server
make

You can check if you have compiled it in with

thughes@krypton [0] $ ./telegraf --input-list|grep lanz
  lanz_consumer

and

thughes@krypton [0] $ ./telegraf --input-filter lanz_consumer config|tail -n 20 


###############################################################################
#                            INPUT PLUGINS                                    #
###############################################################################


###############################################################################
#                            SERVICE INPUT PLUGINS                            #
###############################################################################

# Read metrics off Arista LANZ, via socket
[[inputs.lanz_consumer]]
  	## URL to Arista LANZ endpoint
  	# servers = "tcp://localhost:50001"
  	servers = [
		"tcp://switch02.int.example.com:50001",
		"tcp://switch02.int.example.com:50001"

I have uploaded a binary at https://github.com/timhughes/telegraf/releases/tag/XXXXXX

@lukebigum can you check this new binary works in the office when you have time

@littlespace
Copy link

Thanks for all the info! I am testing it on a Arista 7508N running 4.21.1.1F. I do not get any errors, and the plugin is loaded and connected to the Arista but no data.

sh queue-monitor streaming clients
Number of clients connected : 1

Thanks,
Mike

@bewing
Copy link

bewing commented Oct 24, 2019

@lukebigum Do you have the JSON for that grafana dashboard?

@lukebigum
Copy link
Author

@lukebigum
Copy link
Author

@hughest I also tried your May binary, works fine here.

@timhughes
Copy link

@bewing @lukebigum if you have any issues can you let me know on influxdata/telegraf#4112 and I will get them fixed.

@timhughes
Copy link

This looks like it may be accepted into master on the next release (1.14). As part of the work to get it merged I have had to change some of the names. For details check influxdata/telegraf@0704cfe#diff-abb0fadf1541b14f2c4822a3e2de5ac8

The plugin name has changed from lanz_consumer to just lanz and the docs have been updated with links on how to set up the Arista switches https://github.com/timhughes/telegraf/blob/lanz_consumer_multi_server/plugins/inputs/lanz/README.md

The record names have had lanz_ prepended so they become

  • lanz_congestion_record
  • lanz_global_buffer_usage_record

The hostname tags have been changed to source

There is a new binary built if you have a login to circleci you can get it for any platform at https://circleci.com/gh/influxdata/telegraf/49665#artifacts/containers/0

Here is a direct link to the Linux artifact from the build system if you dont want to create a login to circleci
https://49665-33258973-gh.circle-artifacts.com/0/build/linux/amd64/telegraf-1.14.0%7Edacfaa4c_linux_amd64.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment