I'm running telegraf in a container on my Synlogy NAS. Just asking out there what is the best way to reload the configuration when I make some changes in telegraf.conf.
I have seen a suggestion to restart the whole container, here: https://hub.docker.com/_/telegraf
Like this:
$ docker restart telegraf
How about just executing a kill command with SIGHUP for the telegraf process within the container?
Something like this:
admin@Docker:~% sudo docker ps | grep telegraf
Password:
4c69a263326d telegraf:latest "/entrypoint.sh tele…" 3 weeks ago Up 20 minutes telegraf
admin@Docker:~% sudo docker exec -it -u 0 4c69a263326d kill -1 1
admin@Docker:~% sudo docker ps | grep telegraf
4c69a263326d telegraf:latest "/entrypoint.sh tele…" 3 weeks ago Up 21 minutes telegraf
admin@Docker:~% sudo docker logs --tail 10 4c69a263326d
2020-06-09T11:50:37Z I! [agent] Hang on, flushing any cached metrics before shutdown
2020-06-09T11:50:37Z I! Starting Telegraf 1.14.2
2020-06-09T11:50:37Z I! Using config file: /etc/telegraf/telegraf.conf
2020-06-09T11:50:37Z I! Loaded inputs: snmp
2020-06-09T11:50:37Z I! Loaded aggregators:
2020-06-09T11:50:37Z I! Loaded processors:
2020-06-09T11:50:37Z I! Loaded outputs: influxdb
2020-06-09T11:50:37Z I! Tags enabled: host=Docker
2020-06-09T11:50:37Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"Docker", Flush Interval:10s
2020-06-09T11:50:37Z W! [outputs.influxdb] When writing to [https://127.0.0.1:8086]: database "telegraf" creation failed: 403 Forbidden