Last active
September 14, 2018 14:56
-
-
Save affo/f30f5b62313fd4bd9598810688ae61c9 to your computer and use it in GitHub Desktop.
Scripts to start InfluxDB, Flux, and query InfluxDB using Flux with Docker containers.
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
#!/bin/bash | |
docker run --net host --rm byrnedo/alpine-curl -XPOST -d "$@" http://localhost:8093/query/ | |
# example query | |
# '{"query": "from(bucket: \"telegraf\") |> range(start: -10s) |> filter(fn: (r) => r._measurement == \"cpu\" and r._field == \"usage_system\")"}' | |
# or (unescaped): | |
# from(bucket: "telegraf") |> range(start: -10s) |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_system") |
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
#!/bin/bash | |
docker volume rm influxdb | |
docker volume create influxdb | |
echo "Running InfluxDB..." | |
docker run -d --name=influxdb --net host -v influxdb:/var/lib/influxdb quay.io/influxdb/influxdb:nightly | |
sleep 3 | |
echo "Running FLUX..." | |
docker run -d --name=flux --net host quay.io/influxdb/flux:nightly | |
sleep 3 | |
echo "Running Telegraf..." | |
docker run -d --name=telegraf --net host telegraf | |
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
#!/bin/bash | |
docker rm -f influxdb | |
docker rm -f flux | |
docker rm -f telegraf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment