homeserver/monitoring/test-telegraf.sh
2021-01-09 21:25:08 +01:00

20 lines
561 B
Bash

# call this script like "./test-telegraf.sh net:cpu"
docker run \
--rm \
--volume $(pwd)/telegraf/telegraf.conf:/telegraf.conf \
--volume /:/hostfs:ro \
--volume /var/run/utmp:/var/run/utmp:ro \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
-e HOST_ETC=/hostfs/etc \
-e HOST_PROC=/hostfs/proc \
-e HOST_SYS=/hostfs/sys \
-e HOST_VAR=/hostfs/var \
-e HOST_RUN=/hostfs/run \
-e HOST_MOUNT_PREFIX=/hostfs \
telegraf \
telegraf \
--config /telegraf.conf \
--input-filter $1 \
--test