Last active
March 14, 2021 17:31
-
-
Save jk/933841aed593848680a61bc4b7294df6 to your computer and use it in GitHub Desktop.
Telegraf Speedtest
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
# 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" | |
] |
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
#!/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