Skip to content

Commit 710a464

Browse files
committed
20211015 Telegraf - defaults - master branch - PR 1 of 3
Changes `telegraf` Dockerfile so that the configuration for sending metrics to InfluxDB uses the "internal network" URL: ``` http://influxdb:8086 ``` On a clean install, Telegraf should communicate with InfluxDB "out of the box". Acknowledgement: this problem was discovered by [Discord user "tablatronix"](https://discord.com/channels/638610460567928832/638610461109256194/898349626179076096)
1 parent 651a30b commit 710a464

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.templates/telegraf/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ RUN apt update && apt install -y rsync
77
# where IOTstack template files are stored
88
ENV IOTSTACK_DEFAULTS_DIR="iotstack_defaults"
99

10-
# make a copy of the default config file
10+
# make a copy of the default config file and point to influxdb container
1111
RUN mkdir -p /${IOTSTACK_DEFAULTS_DIR} && \
12-
cp /etc/telegraf/telegraf.conf /${IOTSTACK_DEFAULTS_DIR}/
12+
cp /etc/telegraf/telegraf.conf /${IOTSTACK_DEFAULTS_DIR}/ && \
13+
sed -i.bak \
14+
'/^\[\[outputs.influxdb\]\]/a\ \ urls = ["http://influxdb:8086"]' \
15+
/${IOTSTACK_DEFAULTS_DIR}/telegraf.conf
1316

1417
# replace the docker entry-point script with a self-repairing version
1518
ENV IOTSTACK_ENTRY_POINT="entrypoint.sh"

0 commit comments

Comments
 (0)