Skip to content

Instantly share code, notes, and snippets.

@kenchan
Created February 27, 2018 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenchan/dcf0e563c087677a4edf444a1603896b to your computer and use it in GitHub Desktop.
Save kenchan/dcf0e563c087677a4edf444a1603896b to your computer and use it in GitHub Desktop.
/home/pi/bin/speedtest-cli --server 14623 --json | jq --arg date $(date "+%s") '[{name: "speed_test.download", value: (.download / 1000000), time: $date|tonumber}, {name: "speed_test.upload", value: (.upload / 1000000), time: $date|tonumber}]' | curl -X POST -H "X-Api-Key: #{API_KEY}" -H "Content-Type: application/json" https://api.mackerelio.com/api/v0/services/Home/tsdb -d @-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment