Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Telegraf Speedtest
#!/bin/bash
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt install -y telegraf
# Add this to /etc/telegraf/telegraf.conf
[[inputs.exec]]
commands = [
"/usr/local/bin/speedtest-cli --json"
]
timeout = "1m"
interval = "10m"
name_suffix = "_speedtest"
data_format = "json"
tag_keys = [
"client_isp",
"client_ip",
"server_id",
"server_name",
"server_country",
"server_cc"
]
#!/bin/bash
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod a+x speedtest-cli
sudo mv speedtest-cli /usr/local/bin
#!/bin/bash
sudo systemctl enable telegraf
sudo systemctl restart telegraf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment