script for pushing to influxdb

This commit is contained in:
Thomas Ruoff
2017-05-30 21:59:21 +02:00
parent eafa9c1e41
commit 5ced841cde

17
toInfluxDb.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# TODO: explain usage
set -e
HOST=${INFLUXDB_HOST:-localhost}
PORT=${INFLUXDB_PORT:-8086}
DATABASE=${INFLUXDB_DATABASE:-feinstaub}
PRECISION=s
SRC_FILE=${1:-/dev/stdin}
curl --include -X POST \
"http://${HOST}:${PORT}/write?db=${DATABASE}&precision=${PRECISION}" \
--data-binary @${SRC_FILE}